Changeset 742


Ignore:
Timestamp:
Nov 30, 2010, 6:36:51 PM (9 years ago)
Author:
ksherdy
Message:

Add utility method to print array values, little-endian, right-to-left.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/lib_simd.h

    r709 r742  
    268268}
    269269
    270 #endif
    271 
     270/* Prints the array values little endian, right to left. */ 
     271static void print_array_le(const char * var_name, char * buf, int size) {
     272  unsigned char c;
     273  printf("%30s = ", var_name);
     274  for(int i=size-1; i>=0; i--) {
     275    c = buf[i];
     276    if(c == 0) {
     277      printf("0");      // print zero for UTF code point 0
     278    } else {
     279      printf("%c", c); 
     280    }
     281    if(i%8 == 0) {
     282      printf(" ");      // print a single space separator
     283    }
     284  }
     285  printf("\n");
     286}
     287
     288#endif
     289
Note: See TracChangeset for help on using the changeset viewer.