ioc/dbStatic: make offset in field description an unsigned short, add cast to code generator

fixes ~2600 compiler warnings (on windows-x64)
This commit is contained in:
Ralph Lange
2014-05-22 16:18:02 +02:00
parent 7dd5e217f6
commit 271e1811e3
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ typedef struct dbFldDes{ /* field description */
/*On no runtime following only set for STRING */
short size; /*length in bytes of a field element */
/*The following are only available on run time system*/
short offset; /*Offset in bytes from beginning of record*/
unsigned short offset; /*Offset in bytes from beginning of record*/
}dbFldDes;
typedef struct dbInfoNode { /*non-field per-record information*/
+2 -2
View File
@@ -124,8 +124,8 @@ sub oldtables {
"sizeof(prec->" . $_->C_name . ");"
} $rtyp->fields) . "\n" .
join("\n", map {
" prt->papFldDes[${rn}Record" . $_->name . "]->offset = " .
"(char *)&prec->" . $_->C_name . " - (char *)prec;"
" prt->papFldDes[${rn}Record" . $_->name . "]->offset = (unsigned short)(" .
"(char *)&prec->" . $_->C_name . " - (char *)prec);"
} $rtyp->fields) . "\n" .
" prt->rec_size = sizeof(*prec);\n" .
" return 0;\n" .