Changeset 628
- Timestamp:
- Jul 18, 2015, 2:52:49 PM (9 years ago)
- Location:
- soft/giet_vm/giet_libs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/stdio.c
r623 r628 175 175 176 176 { 177 char buf[30];178 char * pbuf;179 unsigned int len = 0;177 char buf[30]; 178 char * pbuf; 179 unsigned int len = 0; 180 180 static const char HexaTab[] = "0123456789ABCDEF"; 181 unsigned int i;181 unsigned int i; 182 182 183 183 /* Ignored fields : width and precision */ … … 244 244 int imax; 245 245 246 if (modifiers == LL_MOD) // 64 bits246 if (modifiers == LL_MOD) // 64 bits 247 247 { 248 248 val = va_arg( *args, unsigned long long); 249 249 250 if (*(format-1) == 'u' && (!(val & 0xFFFFFFFF00000000))) //if asked to print in base 10, can do only if it fits in 32 bits 250 // if asked to print in base 10, can do only if it fits in 32 bits 251 if (*(format-1) == 'u' && (!(val & 0xFFFFFFFF00000000ULL))) 251 252 { 252 253 unsigned int uintv = (unsigned int) val; … … 308 309 unsigned long long 309 310 val = *(unsigned long long*)&vald, //get ieee754 without conversion 310 digits = val & 0xFFFFFFFFFFFFF ; //get mantissa311 digits = val & 0xFFFFFFFFFFFFFULL; //get mantissa 311 312 312 313 unsigned int 313 base = (unsigned int)((val & 0x7FF0000000000000 ) >> 52), //get exposant314 base = (unsigned int)((val & 0x7FF0000000000000ULL) >> 52), //get exposant 314 315 intp = (unsigned int)vald, //get integer part of the float 315 316 decp; … … 319 320 if (base == 0x7FF) //special value 320 321 { 321 if (digits & 0xFFFFFFFFFFFFF )322 if (digits & 0xFFFFFFFFFFFFFULL) 322 323 { 323 324 /* Not a Number */ … … 331 332 { 332 333 /* inf */ 333 buf[0] = (val & 0x8000000000000000 ) ? '-' : '+';334 buf[0] = (val & 0x8000000000000000ULL) ? '-' : '+'; 334 335 buf[1] = 'i'; 335 336 buf[2] = 'n'; … … 341 342 } 342 343 343 if (val & 0x8000000000000000 )344 if (val & 0x8000000000000000ULL) 344 345 { 345 346 /* negative */ … … 1002 1003 } 1003 1004 1005 ////////////////////////////// 1006 void giet_kill( char* name ) 1007 { 1008 sys_call( SYSCALL_KILL_APP, 1009 (unsigned int)name, 1010 0, 0, 0 ); 1011 } 1012 1013 ////////////////////////////// 1014 void giet_exec( char* name ) 1015 { 1016 sys_call( SYSCALL_EXIT, 1017 (unsigned int)name, 1018 0, 0, 0 ); 1019 } 1020 1004 1021 ///////////////////////////////////////// 1005 1022 void giet_assert( unsigned int condition, -
soft/giet_vm/giet_libs/stdio.h
r623 r628 40 40 #define SYSCALL_TIM_START 0x15 41 41 #define SYSCALL_TIM_STOP 0x16 42 //0x1743 //0x1842 #define SYSCALL_KILL_APP 0x17 43 #define SYSCALL_EXEC_APP 0x18 44 44 #define SYSCALL_CTX_SWITCH 0x19 45 45 #define SYSCALL_VOBJ_GET_VBASE 0x1A … … 325 325 extern void giet_exit( char* string ); 326 326 327 extern void giet_kill( char* name ); 328 329 extern void giet_exec( char* name ); 330 327 331 extern void giet_assert( unsigned int condition, 328 332 char* string );
Note: See TracChangeset
for help on using the changeset viewer.