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

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

View File

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

View File

@@ -212,7 +212,7 @@ inline void __dpmi_free_dos_memory(int buffer) {
#include <sys/nearptr.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 __djgpp_nearptr_enable())
return (void *)0;

View File

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

View File

@@ -98,9 +98,9 @@ int g_init_os(int flags) {
cpu.di(0);
cpu.genint(0x21);
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);
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...
for(i = 0; i < size; i++) {
int c = toupper(i + 128);

View File

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

View File

@@ -113,14 +113,14 @@ extern int __gdvdetected;
#endif
#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;
}
inline void _farpokew(unsigned short s, gdma ptr, word chat) {
inline void _farpokew(uint16_t s, gdma ptr, word chat) {
NW(s);
*ptr = chat;
@@ -131,7 +131,7 @@ inline void _farnspokew(gdma ptr, word chat) {
*ptr = chat;
}
inline word _farpeekw(unsigned short s, gdma ptr) {
inline word _farpeekw(uint16_t s, gdma ptr) {
NW(s);
return *ptr;
@@ -142,7 +142,7 @@ inline void _farnspokeb(byte *ptr, byte chr) {
*ptr = chr;
}
inline void _farsetsel(unsigned short s) {
inline void _farsetsel(uint16_t s) {
NW(s);
}
@@ -154,7 +154,7 @@ const int ATTRSIZE = sizeof(word);
const int ATTRSIZE = 1;
#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__
movedata(seg_s, sel_s, seg_d, sel_d, len);