Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for libplaton/platon/str/strmmx.c between version 1.8 and 1.9

version 1.8, 2002/08/16 20:42:35 version 1.9, 2002/08/27 13:12:33
Line 9 
Line 9 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
 #include "strmmx.h"  
   
 #ifndef FUNCTION  #include "strmmx.h"
 #  define FUNCTION_NAME(_unused, _name) _unused##_name  
 #  define FUNCTION(_name) FUNCTION_NAME(, ## _name)  
 #endif  
   
 static int align(const int n)  static int align(const int n)
 {  {
         return ((n >> 3) + (n % 8 != 0)) << 3;          return ((n >> 3) + (n % 8 != 0)) << 3;
 }  }
   
 char *FUNCTION(strcpymmx)(void *dest, const void *src)  char *PLATON_FUNC(strcpymmx)(void *dest, const void *src)
 {  {
         int len = strlen(src);          int len = strlen(src);
         char *ret = memcpymmx(dest, src, len);          char *ret = memcpymmx(dest, src, len);
Line 29  char *FUNCTION(strcpymmx)(void *dest, co
Line 25  char *FUNCTION(strcpymmx)(void *dest, co
         return ret;          return ret;
 }  }
   
 char *FUNCTION(strncpymmx)(void *dest, const void *src, size_t n)  char *PLATON_FUNC(strncpymmx)(void *dest, const void *src, size_t n)
 {  {
         char *ret = memcpymmx(dest, src, n);          char *ret = memcpymmx(dest, src, n);
         ret[n] = '\0';          ret[n] = '\0';
         return ret;          return ret;
 }  }
   
 void *FUNCTION(memcpymmx)(void *dest, const void *src, size_t n)  void *PLATON_FUNC(memcpymmx)(void *dest, const void *src, size_t n)
 {  {
         if ((n % 8) != 0)          if ((n % 8) != 0)
                 n = align(n);                  n = align(n);
Line 51  void *FUNCTION(memcpymmx)(void *dest, co
Line 47  void *FUNCTION(memcpymmx)(void *dest, co
         return dest;          return dest;
 }  }
   
 void *FUNCTION(memsetmmx)(void *s, int c, size_t n)  void *PLATON_FUNC(memsetmmx)(void *s, int c, size_t n)
 {  {
         char set[8];          char set[8];
         set[0] = set[1] = set[2] = set[3] = set[4] = set[5] = set[6] = set[7] = c;          set[0] = set[1] = set[2] = set[3] = set[4] = set[5] = set[6] = set[7] = c;
Line 68  void *FUNCTION(memsetmmx)(void *s, int c
Line 64  void *FUNCTION(memsetmmx)(void *s, int c
 }  }
   
 /* function returns only 1 or 0  */  /* function returns only 1 or 0  */
 int FUNCTION(memcmpmmx)(const void *s1, const void *s2, size_t n)  int PLATON_FUNC(memcmpmmx)(const void *s1, const void *s2, size_t n)
 {  {
         if ((n % 8) != 0)          if ((n % 8) != 0)
                 n = align(n);                  n = align(n);

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top