Change from using platform-specific types to stdint platform-independent types

when reading the structure header.
This commit is contained in:
David Given 2012-09-27 11:32:40 +01:00
parent 2beb3646a7
commit 4349d702fa

View file

@ -23,6 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h>
#include <string.h> #include <string.h>
#include "out.h" #include "out.h"
@ -221,7 +222,7 @@ void iconvert(char* buf, char* str, char* fmt)
{ {
register char *nf, *ni, *no ; register char *nf, *ni, *no ;
int last, i ; int last, i ;
long value ; uint32_t value ;
ni=buf ; no=str ; nf=fmt ; ni=buf ; no=str ; nf=fmt ;
while ( last = *nf++ ) { while ( last = *nf++ ) {
last -= '0' ; last -= '0' ;
@ -234,8 +235,8 @@ void iconvert(char* buf, char* str, char* fmt)
switch ( last ) { switch ( last ) {
case 0 : break ; case 0 : break ;
case 1 : *no= value ; break ; case 1 : *no= value ; break ;
case 2 : *(unsigned short *)no = value ; break ; case 2 : *(uint16_t *)no = value ; break ;
case 4 : *(long *)no = value ; break ; case 4 : *(uint32_t *)no = value ; break ;
default : default :
fatal("illegal out.h format string\n"); fatal("illegal out.h format string\n");
} }