1/* 2 * MatsUtils.c --- 3 * 4 * Some handy utility functions. 5 * 6 * 7 */ 8 9 10#ifdef _WIN32 11# include "QuickTimeTclWin.h" 12#endif 13 14#include "MatsUtils.h" 15 16void BitStringFromX( unsigned int flag, int n, char *str ) 17{ 18 int i; 19 20 str[n] = '\0'; 21 for (i = 0; i < n; i++, flag >>= 1) 22 str[n-1-i] = ((flag & 0x0001) == 0) ? '0' : '1'; 23} 24 25