Changed part of integer types to intN_t

This commit is contained in:
Ianos Gnatiuc 2005-10-22 14:44:25 +00:00
parent 98ed5a2a37
commit 1f4f8695e5
16 changed files with 85 additions and 90 deletions

View File

@ -618,7 +618,7 @@ void ReadXlatTables() {
memset(&ChsTable, 0, sizeof(Chs)); memset(&ChsTable, 0, sizeof(Chs));
for(n=0; n<256; n++) { for(n=0; n<256; n++) {
ChsTable.t[n][0] = 1; ChsTable.t[n][0] = 1;
ChsTable.t[n][1] = (unsigned char)n; // The character ChsTable.t[n][1] = (uint8_t)n; // The character
} }
strcpy(buf, AddPath(CFG->xlatpath, xlt->mapfile)); strcpy(buf, AddPath(CFG->xlatpath, xlt->mapfile));
ifp = fsopen(buf, "rb", CFG->sharemode); ifp = fsopen(buf, "rb", CFG->sharemode);
@ -677,13 +677,13 @@ void ReadXlatTables() {
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
break; break;
case 'd': case 'd':
y = (unsigned char)atoi(ptr+1); y = (uint8_t)atoi(ptr+1);
ChsTable.t[ch][++x] = (byte)y; ChsTable.t[ch][++x] = (byte)y;
ChsTable.t[ch][0] = (byte)x; ChsTable.t[ch][0] = (byte)x;
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
break; break;
case 'x': case 'x':
y = (unsigned char)atox(ptr+1); y = (uint8_t)atox(ptr+1);
ChsTable.t[ch][++x] = (byte)y; ChsTable.t[ch][++x] = (byte)y;
ChsTable.t[ch][0] = (byte)x; ChsTable.t[ch][0] = (byte)x;
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
@ -757,11 +757,11 @@ void ReadXlatTables() {
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
break; break;
case 'd': case 'd':
EscTable.t[n][x++] = (unsigned char)atoi(ptr+1); EscTable.t[n][x++] = (uint8_t)atoi(ptr+1);
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
break; break;
case 'x': case 'x':
EscTable.t[n][x++] = (unsigned char)atox(ptr+1); EscTable.t[n][x++] = (uint8_t)atox(ptr+1);
ptr = strskip_txt(ptr); ptr = strskip_txt(ptr);
break; break;
case '0': case '0':

View File

@ -80,12 +80,12 @@ void gbmh::init(const char* pattern, bool ignorecase) {
for(i=0; i<patlen; i++) { for(i=0; i<patlen; i++) {
skip[pat[i] & 0xff] = patlen - i - 1; skip[pat[i] & 0xff] = patlen - i - 1;
if(ignore_case) if(ignore_case)
skip[tolower((unsigned char)pat[i])] = patlen - i - 1; skip[tolower((uint8_t)pat[i])] = patlen - i - 1;
} }
char lastpatchar = pat[patlen - 1]; char lastpatchar = pat[patlen - 1];
skip[lastpatchar & 0xff] = INT_MAX; skip[lastpatchar & 0xff] = INT_MAX;
if(ignore_case) if(ignore_case)
skip[tolower((unsigned char)lastpatchar)] = INT_MAX; skip[tolower((uint8_t)lastpatchar)] = INT_MAX;
// Horspool's fixed second shift // Horspool's fixed second shift
skip2 = patlen; skip2 = patlen;
@ -120,7 +120,7 @@ bool gbmh::find(const char* buffer) {
const char* s = buffer + (i - j); const char* s = buffer + (i - j);
if(ignore_case) { if(ignore_case) {
while(--j >= 0 and toupper((unsigned char)s[j]) == pat[j]) while(--j >= 0 and toupper((uint8_t)s[j]) == pat[j])
; ;
} }
else { else {

View File

@ -41,8 +41,8 @@
#include <ctype.h> #include <ctype.h>
#if defined(__EMX__) #if defined(__EMX__)
#include <sys/nls.h> #include <sys/nls.h>
#define tolower(c) _nls_tolower((unsigned char)(c)) #define tolower(c) _nls_tolower((uint8_t)(c))
#define toupper(c) _nls_toupper((unsigned char)(c)) #define toupper(c) _nls_toupper((uint8_t)(c))
#elif defined(__WIN32__) #elif defined(__WIN32__)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -52,8 +52,8 @@ __inline__ int toupper(int c) { return tu[c]; }
} }
#else #else
extern char tl[256], tu[256]; extern char tl[256], tu[256];
#define tolower(c) tl[(int)(unsigned char)(c)] #define tolower(c) tl[(int)(uint8_t)(c)]
#define toupper(c) tu[(int)(unsigned char)(c)] #define toupper(c) tu[(int)(uint8_t)(c)]
#endif #endif
#endif #endif

View File

@ -212,7 +212,7 @@ inline void __dpmi_free_dos_memory(int buffer) {
#include <sys/nearptr.h> #include <sys/nearptr.h>
#include <crt0.h> #include <crt0.h>
inline void *gmkfp(unsigned short seg, unsigned short ofs) { inline void *gmkfp(uint16_t seg, uint16_t ofs) {
if(not (_crt0_startup_flags & _CRT0_FLAG_NEARPTR)) if(not (_crt0_startup_flags & _CRT0_FLAG_NEARPTR))
if(not __djgpp_nearptr_enable()) if(not __djgpp_nearptr_enable())
return (void *)0; return (void *)0;

View File

@ -41,8 +41,8 @@
#if defined(__EMX__) #if defined(__EMX__)
#include <sys/nls.h> #include <sys/nls.h>
#define strupr(s) (char *)_nls_strupr((unsigned char *)(s)) #define strupr(s) (char *)_nls_strupr((uint8_t *)(s))
#define strlwr(s) (char *)_nls_strlwr((unsigned char *)(s)) #define strlwr(s) (char *)_nls_strlwr((uint8_t *)(s))
#elif defined(__GNUC__) #elif defined(__GNUC__)
#if defined(__QNXNTO__) #if defined(__QNXNTO__)
#include <strings.h> #include <strings.h>

View File

@ -98,9 +98,9 @@ int g_init_os(int flags) {
cpu.di(0); cpu.di(0);
cpu.genint(0x21); cpu.genint(0x21);
if(not (cpu.flags() & 1) and (cpu.cx() == 5)) { if(not (cpu.flags() & 1) and (cpu.cx() == 5)) {
unsigned int table = _farpeekw(selector, 3) * 16 + _farpeekw(selector, 1); uint32_t table = _farpeekw(selector, 3) * 16 + _farpeekw(selector, 1);
int i, size = _farpeekw(_dos_ds, table); int i, size = _farpeekw(_dos_ds, table);
movedata(_dos_ds, table + 2, _my_ds(), (unsigned int)&(toupper(128)), size); movedata(_dos_ds, table + 2, _my_ds(), (uint32_t)&(toupper(128)), size);
// let's build lowercase table from uppercase... // let's build lowercase table from uppercase...
for(i = 0; i < size; i++) { for(i = 0; i < size; i++) {
int c = toupper(i + 128); int c = toupper(i + 128);

View File

@ -256,9 +256,9 @@ char *gcpuid(char *_cpuname)
#else #else
char vendor[3*sizeof(dword)+1]; /* CPU vendor string 12 bytes, 13th byte is zero */ char vendor[3*sizeof(dword)+1]; /* CPU vendor string 12 bytes, 13th byte is zero */
#endif #endif
unsigned char family; /* CPU stepping number, 4 bits */ uint8_t family; /* CPU stepping number, 4 bits */
unsigned char model; /* CPU model number, 4 bits */ uint8_t model; /* CPU model number, 4 bits */
unsigned char stepping; /* CPU stepping value, 4 bits */ uint8_t stepping; /* CPU stepping value, 4 bits */
// unsigned cpu_id; /* stepping ID, 12 bits: 0x0FMS */ // unsigned cpu_id; /* stepping ID, 12 bits: 0x0FMS */
// unsigned features; /* CPU features info */ // unsigned features; /* CPU features info */
}scpuid; /* ISO C: static variabled is initialised with 0 */ }scpuid; /* ISO C: static variabled is initialised with 0 */

View File

@ -113,14 +113,14 @@ extern int __gdvdetected;
#endif #endif
#ifndef __DJGPP__ #ifndef __DJGPP__
const unsigned short _dos_ds = 0; const uint16_t _dos_ds = 0;
inline unsigned short _my_ds(void) { inline uint16_t _my_ds(void) {
return 0; return 0;
} }
inline void _farpokew(unsigned short s, gdma ptr, word chat) { inline void _farpokew(uint16_t s, gdma ptr, word chat) {
NW(s); NW(s);
*ptr = chat; *ptr = chat;
@ -131,7 +131,7 @@ inline void _farnspokew(gdma ptr, word chat) {
*ptr = chat; *ptr = chat;
} }
inline word _farpeekw(unsigned short s, gdma ptr) { inline word _farpeekw(uint16_t s, gdma ptr) {
NW(s); NW(s);
return *ptr; return *ptr;
@ -142,7 +142,7 @@ inline void _farnspokeb(byte *ptr, byte chr) {
*ptr = chr; *ptr = chr;
} }
inline void _farsetsel(unsigned short s) { inline void _farsetsel(uint16_t s) {
NW(s); NW(s);
} }
@ -154,7 +154,7 @@ const int ATTRSIZE = sizeof(word);
const int ATTRSIZE = 1; const int ATTRSIZE = 1;
#endif #endif
inline void gdmacpy(unsigned short seg_d, gdma sel_d, unsigned short seg_s, gdma sel_s, int len) { inline void gdmacpy(uint16_t seg_d, gdma sel_d, uint16_t seg_s, gdma sel_s, int len) {
#ifdef __DJGPP__ #ifdef __DJGPP__
movedata(seg_s, sel_s, seg_d, sel_d, len); movedata(seg_s, sel_s, seg_d, sel_d, len);

View File

@ -66,7 +66,7 @@ typedef char AskType; // 0=yes, 1=no, 2=ask
typedef char MsgType; // 0=localmail, 1=netmail, 2=echomail, 3=passthru, 4=waitthru, 5=allmail typedef char MsgType; // 0=localmail, 1=netmail, 2=echomail, 3=passthru, 4=waitthru, 5=allmail
typedef char MsgKindsType; // 0=public, 1=private, 2=private or public typedef char MsgKindsType; // 0=public, 1=private, 2=private or public
typedef char UserString[36]; typedef char UserString[36];
typedef unsigned char EzFlagType[4]; typedef uint8_t EzFlagType[4];
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -141,8 +141,8 @@ typedef struct {
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
struct _stamp struct _stamp
begin begin
unsigned short date; uint16_t date;
unsigned short time; uint16_t time;
end; end;

View File

@ -34,13 +34,6 @@
#pragma pack(1) #pragma pack(1)
#endif #endif
// ------------------------------------------------------------------
// Typedefs
typedef unsigned char _boolean;
typedef unsigned char byte;
typedef unsigned short word;
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Constants // Constants
@ -76,7 +69,7 @@ struct OriginLineRecord {
struct EchoMailConferenceRecord { struct EchoMailConferenceRecord {
_boolean PassThru; bool PassThru;
word ConfNum; word ConfNum;
word ConfTag; word ConfTag;
@ -86,19 +79,19 @@ struct EchoMailConferenceRecord {
word AreaLevel; word AreaLevel;
_boolean CheckForDupes; bool CheckForDupes;
_boolean ImportSeenByLines; bool ImportSeenByLines;
_boolean ImportPathLines; bool ImportPathLines;
_boolean KeepPrivate; bool KeepPrivate;
_boolean Deleted; bool Deleted;
byte OriginLine; byte OriginLine;
byte Group; byte Group;
_boolean ScanPrivate; bool ScanPrivate;
_boolean Mandatory; bool Mandatory;
_boolean ForcePrivate; bool ForcePrivate;
byte Extra[45]; byte Extra[45];
}; };

View File

@ -54,11 +54,11 @@ enum MailTypeDef {
struct AddressRec { struct AddressRec {
unsigned short Zone; uint16_t Zone;
unsigned short Net; uint16_t Net;
unsigned short Node; uint16_t Node;
unsigned short Point; uint16_t Point;
char Domain[21]; char Domain[21];
}; };
@ -67,34 +67,34 @@ struct AddressRec {
struct EchoAreaRec { struct EchoAreaRec {
char Name[41]; // Area Name char Name[41]; // Area Name
char Descr[61]; // Description char Descr[61]; // Description
unsigned char MailType; // (MailTypeDef) local, netmail or what uint8_t MailType; // (MailTypeDef) local, netmail or what
unsigned char StoreType; // (MsgBaseType) uint8_t StoreType; // (MsgBaseType)
char MsgDirectory[61]; // ... and the corresponding directory char MsgDirectory[61]; // ... and the corresponding directory
unsigned short ReadSecurity; // Read access level uint16_t ReadSecurity; // Read access level
unsigned short WriteSecurity; // Write access level uint16_t WriteSecurity; // Write access level
char OriginLine[61]; // Origin line for this echo char OriginLine[61]; // Origin line for this echo
AddressRec AreaAddress; // Adress of sender for this echo AddressRec AreaAddress; // Adress of sender for this echo
unsigned char ConferenceNr; // The conference this echo belongs to. If 0 the echo has NO conference uint8_t ConferenceNr; // The conference this echo belongs to. If 0 the echo has NO conference
unsigned short maxdays; uint16_t maxdays;
unsigned short maxrecv; uint16_t maxrecv;
unsigned short maxcount; uint16_t maxcount;
unsigned short totalimp; uint16_t totalimp;
unsigned short totalexp; // Purge info uint16_t totalexp; // Purge info
long totalimpL; int32_t totalimpL;
long totalexpL; // total # of msgs imported/exported in this echo int32_t totalexpL; // total # of msgs imported/exported in this echo
unsigned char BasePathStrip; // Don't import PATH line to base uint8_t BasePathStrip; // Don't import PATH line to base
unsigned char ExportPathStrip; // Strip PATH line for downlinks uint8_t ExportPathStrip; // Strip PATH line for downlinks
unsigned char BaseSeenStrip; // Don't import SEEN-BY to base uint8_t BaseSeenStrip; // Don't import SEEN-BY to base
unsigned char ExportSeenStrip; // Strip SEEN-BY for downlinks uint8_t ExportSeenStrip; // Strip SEEN-BY for downlinks
unsigned short AbsCosts; uint16_t AbsCosts;
unsigned short RelCosts; // The cost for each mail in this echo uint16_t RelCosts; // The cost for each mail in this echo
long LastActionDate; // Last date something happened in this echo int32_t LastActionDate; // Last date something happened in this echo
unsigned char NeverRemove; // Never remove this echo automatically uint8_t NeverRemove; // Never remove this echo automatically
unsigned short MaxDupes; // Maximum nr. of Dupes uint16_t MaxDupes; // Maximum nr. of Dupes
unsigned char SkipPathCheck; uint8_t SkipPathCheck;
unsigned char Dummy[106]; // unused uint8_t Dummy[106]; // unused
}; };

View File

@ -4275,9 +4275,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
case charset_not: case charset_not:
{ {
register unsigned char c; register unsigned char c;
boolean not = (re_opcode_t) *(p - 1) == charset_not; boolean not_bool = (re_opcode_t) *(p - 1) == charset_not;
DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); DEBUG_PRINT2 ("EXECUTING charset%s.\n", not_bool ? "_not" : "");
PREFETCH (); PREFETCH ();
c = TRANSLATE (*d); /* The character to match. */ c = TRANSLATE (*d); /* The character to match. */
@ -4286,11 +4286,11 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
bit list is a full 32 bytes long. */ bit list is a full 32 bytes long. */
if (c < (unsigned) (*p * BYTEWIDTH) if (c < (unsigned) (*p * BYTEWIDTH)
&& p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
not = !not; not_bool = !not_bool;
p += 1 + *p; p += 1 + *p;
if (!not) goto fail; if (!not_bool) goto fail;
SET_REGS_MATCHED (); SET_REGS_MATCHED ();
d++; d++;
@ -4759,15 +4759,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
else if ((re_opcode_t) p1[3] == charset else if ((re_opcode_t) p1[3] == charset
|| (re_opcode_t) p1[3] == charset_not) || (re_opcode_t) p1[3] == charset_not)
{ {
int not = (re_opcode_t) p1[3] == charset_not; int not_int = (re_opcode_t) p1[3] == charset_not;
if (c < (unsigned char) (p1[4] * BYTEWIDTH) if (c < (unsigned char) (p1[4] * BYTEWIDTH)
&& p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
not = !not; not_int = !not_int;
/* `not' is equal to 1 if c would match, which means /* `not' is equal to 1 if c would match, which means
that we can't change to pop_failure_jump. */ that we can't change to pop_failure_jump. */
if (!not) if (!not_int)
{ {
p[-3] = (unsigned char) pop_failure_jump; p[-3] = (unsigned char) pop_failure_jump;
DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); DEBUG_PRINT1 (" No match => pop_failure_jump.\n");

View File

@ -37,6 +37,8 @@ extern "C" {
# include <stddef.h> # include <stddef.h>
#endif #endif
#include <gdefs.h>
/* The following two types have to be signed and unsigned integer type /* The following two types have to be signed and unsigned integer type
wide enough to hold a value of a pointer. For most ANSI compilers wide enough to hold a value of a pointer. For most ANSI compilers
ptrdiff_t and size_t should be likely OK. Still size of these two ptrdiff_t and size_t should be likely OK. Still size of these two

View File

@ -55,7 +55,7 @@
* Returns: NULL == File not found. * Returns: NULL == File not found.
*/ */
FFIND *FFindOpen(const char *filespec, unsigned short attribute) FFIND *FFindOpen(const char *filespec, uint16_t attribute)
{ {
FFIND *ff; FFIND *ff;

View File

@ -77,8 +77,8 @@ struct ffind
{ {
/* this is the public area of the struct */ /* this is the public area of the struct */
char ff_attrib; char ff_attrib;
unsigned short ff_ftime; uint16_t ff_ftime;
unsigned short ff_fdate; uint16_t ff_fdate;
long ff_fsize; long ff_fsize;
char ff_name[256]; char ff_name[256];
@ -95,7 +95,7 @@ struct ffind
#if defined(__386__) || defined(__FLAT__) #if defined(__386__) || defined(__FLAT__)
unsigned long hdir; /* directory handle from DosFindFirst */ unsigned long hdir; /* directory handle from DosFindFirst */
#else #else
unsigned short hdir; /* directory handle from DosFindFirst */ uint16_t hdir; /* directory handle from DosFindFirst */
#endif #endif
#elif defined(UNIX) #elif defined(UNIX)
@ -124,7 +124,7 @@ struct ffind
* prevent name clashes with the Win32 API * prevent name clashes with the Win32 API
*/ */
FFIND *FFindOpen(const char *filespec, unsigned short attribute); FFIND *FFindOpen(const char *filespec, uint16_t attribute);
FFIND *FFindInfo(const char *filespec); FFIND *FFindInfo(const char *filespec);
int FFindNext(FFIND * ff); int FFindNext(FFIND * ff);
void FFindClose(FFIND * ff); void FFindClose(FFIND * ff);