attempt to avoid questpgr convert woes on cross-compile by making the int sizes fixed

This commit is contained in:
nhmall
2019-11-24 00:11:26 -05:00
parent cc7f1185d8
commit b8a6d82c57
3 changed files with 64 additions and 26 deletions

View File

@@ -22,6 +22,7 @@
#include "context.h"
#include "flag.h"
#include "dlb.h"
#include "integer.h"
/* version information */
#ifdef SHORT_FILENAMES
@@ -2088,7 +2089,7 @@ static void
adjust_qt_hdrs()
{
int i, j;
long count = 0L, hdr_offset = sizeof(int)
QTOFFSIZ count = 0L, hdr_offset = sizeof(int)
+ (sizeof(char) * LEN_HDR + sizeof(long))
* qt_hdr.n_hdr;
@@ -2123,7 +2124,15 @@ put_qt_hdrs()
qt_hdr.n_hdr, ofp);
if (debug) {
for (i = 0; i < qt_hdr.n_hdr; i++)
#if (QT_PREPROC == 64)
#ifdef WIN32
Fprintf(stderr, "%s @ %I64d, ", qt_hdr.id[i], qt_hdr.offset[i]);
#else
Fprintf(stderr, "%s @ %I64ld, ", qt_hdr.id[i], qt_hdr.offset[i]);
#endif
#else
Fprintf(stderr, "%s @ %ld, ", qt_hdr.id[i], qt_hdr.offset[i]);
#endif
Fprintf(stderr, "\n");
}
@@ -2142,12 +2151,28 @@ put_qt_hdrs()
int j;
for (j = 0; j < msg_hdr[i].n_msg; j++) {
#if (QT_PREPROC == 64)
#ifdef WIN32
Fprintf(stderr, "msg %d @ %I64d (%I64d)",
#else
Fprintf(stderr, "msg %d @ %I64ld (%I64ld)",
#endif
#else
Fprintf(stderr, "msg %d @ %ld (%ld)",
#endif
msg_hdr[i].qt_msg[j].msgnum,
msg_hdr[i].qt_msg[j].offset,
msg_hdr[i].qt_msg[j].size);
if (msg_hdr[i].qt_msg[j].summary_size)
#if (QT_PREPROC == 64)
#ifdef WIN32
Fprintf(stderr, " [%I64d]",
#else
Fprintf(stderr, " [%I64ld]",
#endif
#else
Fprintf(stderr, " [%ld]",
#endif
msg_hdr[i].qt_msg[j].summary_size);
Fprintf(stderr, "\n");
}