src/globals/utils.c
char* binstr64(uns64 value) {
  static char bin64_buffer[MAX_SIMULTANEOUS_STRINGS][MAX_STR_LENGTH + 1];
  static int  counter = 0;
  int         ii      = 0;
  counter             = CIRC_INC2(counter, MAX_SIMULTANEOUS_STRINGS);
  while(ii < 64) {
    bin64_buffer[counter][ii] = value & 0x1ULL << (63 - ii) ? '1' : '0';
    ii++;
  }
  ASSERT(0, ii < MAX_STR_LENGTH);
  bin64_buffer[counter][ii] = '\0';
  return bin64_buffer[counter];
}
/**************************************************************************************/
/* binstr64: This little function exists to convert a 64-bit integer into a
 string.  Its implementation is a little ugly, but it is intended to be called
 from printf, so I need it to return a pointer to a string.  */
This little function exists to convert a 64-bit integer into a
string.  Its implementation is a little ugly, but it is intended to be called
from printf, so I need it to return a pointer to a string.
This little function exists to convert a 64 - bit integer into a string . Its implementation is a little ugly but it is intended to be called from printf so I need it to return a pointer to a string .
char* binstr64(uns64 value) {
  static char bin64_buffer[MAX_SIMULTANEOUS_STRINGS][MAX_STR_LENGTH + 1];
  static int  counter = 0;
  int         ii      = 0;
  counter             = CIRC_INC2(counter, MAX_SIMULTANEOUS_STRINGS);
  while(ii < 64) {
    bin64_buffer[counter][ii] = value & 0x1ULL << (63 - ii) ? '1' : '0';
    ii++;
  }
  ASSERT(0, ii < MAX_STR_LENGTH);
  bin64_buffer[counter][ii] = '\0';
  return bin64_buffer[counter];
}
char * binstr64 ( uns64 value ) { static char bin64_buffer [ MAX_SIMULTANEOUS_STRINGS ] [ MAX_STR_LENGTH + 1 ] ; static int counter = 0 ; int ii = 0 ; counter = CIRC_INC2 ( counter , MAX_SIMULTANEOUS_STRINGS ) ; while ( ii < 64 ) { bin64_buffer [ counter ] [ ii ] = value & 0x1ULL << ( 63 - ii ) ? ' ' : ' ' ; ii ++ ; } ASSERT ( 0 , ii < MAX_STR_LENGTH ) ; bin64_buffer [ counter ] [ ii ] = ' \0 ' ; return bin64_buffer [ counter ] ; }
binstr64: This little function exists to convert a 64-bit integer into a
string.
binstr64 : This little function exists to convert a 64 - bit integer into a string .