Index: trunk/i386/libsaio/xml.c =================================================================== --- trunk/i386/libsaio/xml.c (revision 924) +++ trunk/i386/libsaio/xml.c (revision 925) @@ -356,7 +356,7 @@ else { printf("ParseStringID error (0x%x)\n", *val); - getc(); + getchar(); return -1; } } @@ -381,7 +381,7 @@ else { printf("ParseStringIDREF error (0x%x)\n", *val); - getc(); + getchar(); return -1; } } @@ -424,7 +424,7 @@ else { printf("ParseIntegerID error (0x%x)\n", *val); - getc(); + getchar(); return -1; } } @@ -449,7 +449,7 @@ else { printf("ParseStringIDREF error (0x%x)\n", *val); - getc(); + getchar(); return -1; } } @@ -670,7 +670,7 @@ if(buffer[0] == '<') { printf("Warning integer is non existant\n"); - getc(); + getchar(); tmpTag = NewTag(); tmpTag->type = kTagTypeInteger; tmpTag->string = 0; @@ -711,7 +711,7 @@ else { printf("ParseTagInteger hex error (0x%x) in buffer %s\n", *val, buffer); - getc(); + getchar(); return -1; } } @@ -732,7 +732,7 @@ if (*val < '0' || *val > '9') { printf("ParseTagInteger decimal error (0x%x) in buffer %s\n", *val, buffer); - getc(); + getchar(); return -1; } @@ -772,7 +772,7 @@ //printf("ParseTagData unimplimented\n"); //printf("Data: %s\n", buffer); - // getc(); + // getchar(); // TODO: base64 decode @@ -804,7 +804,7 @@ if (tmpTag == 0) return -1; printf("ParseTagDate unimplimented\n"); - getc(); + getchar(); tmpTag->type = kTagTypeDate; tmpTag->string = 0; Index: trunk/i386/libsaio/saio_internal.h =================================================================== --- trunk/i386/libsaio/saio_internal.h (revision 924) +++ trunk/i386/libsaio/saio_internal.h (revision 925) @@ -49,7 +49,6 @@ extern int ebiosEjectMedia(int biosdev); extern void bios_putchar(int ch); extern void putca(int ch, int attr, int repeat); -extern int getc(void); extern void pause(); extern int readKeyboardStatus(void); extern int readKeyboardShiftFlags(void); Index: trunk/i386/boot2/resume.c =================================================================== --- trunk/i386/boot2/resume.c (revision 924) +++ trunk/i386/boot2/resume.c (revision 925) @@ -119,7 +119,7 @@ printf ("Resuming from Encrypted image is unsupported.\n" "Uncheck \"Use secure virtual memory\" in \"Security\" pane on system preferences.\n" "Press any key to proceed with normal boot.\n"); - getc (); + getchar (); return; } // depends on NVRAM @@ -143,7 +143,7 @@ if (!((long long)mem_base+allocSize<1024*bootInfo->extmem+0x100000)) { printf ("Not enough space to restore image. Press any key to proceed with normal boot.\n"); - getc (); + getchar (); return; } Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 924) +++ trunk/i386/boot2/boot.c (revision 925) @@ -186,7 +186,7 @@ bool dummyVal; if (getBoolForKey(kWaitForKeypressKey, &dummyVal, &bootInfo->bootConfig) && dummyVal) { printf("Press any key to continue..."); - getc(); + getchar(); } usb_loop(); @@ -351,7 +351,7 @@ #if DEBUG printf(" Default: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags); printf(" bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags); - getc(); + getchar(); #endif useGUI = true; Index: trunk/i386/boot2/modules.c =================================================================== --- trunk/i386/boot2/modules.c (revision 924) +++ trunk/i386/boot2/modules.c (revision 925) @@ -15,7 +15,7 @@ #if CONFIG_MODULE_DEBUG #define DBG(x...) printf(x); -#define DBGPAUSE() getc() +#define DBGPAUSE() getchar() #else #define DBG(x...) #define DBGPAUSE() @@ -85,7 +85,7 @@ else { // The module does not have a valid start function - printf("Unable to start %s\n", SYMBOLS_MODULE); getc(); + printf("Unable to start %s\n", SYMBOLS_MODULE); getchar(); } } } @@ -179,7 +179,7 @@ else // The module does not have a valid start function. This may be a library. { printf("WARNING: Unable to start %s\n", module); - getc(); + getchar(); } #else else msglog("WARNING: Unable to start %s\n", module); @@ -287,7 +287,7 @@ #if CONFIG_MODULE_DEBUG verbose("Unable to locate symbol %s\n", name); - getc(); + getchar(); #endif if(strcmp(name, VOID_SYMBOL) == 0) return 0xFFFFFFFF; @@ -349,7 +349,7 @@ else { verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic); - //getc(); + //getchar(); return NULL; } @@ -358,7 +358,7 @@ /*if(((struct mach_header*)binary)->filetype != MH_DYLIB) { printf("Module is not a dylib. Unable to load.\n"); - getc(); + getchar(); return NULL; // Module is in the incorrect format }*/ @@ -886,7 +886,7 @@ else { printf("Unable to bind symbol %s\n", symbolName); - getc(); + getchar(); } segmentAddress += sizeof(void*); @@ -912,7 +912,7 @@ else { printf("Unable to bind symbol %s\n", symbolName); - getc(); + getchar(); } segmentAddress += tmp + sizeof(void*); @@ -930,7 +930,7 @@ else { printf("Unable to bind symbol %s\n", symbolName); - getc(); + getchar(); } segmentAddress += (immediate * sizeof(void*)) + sizeof(void*); @@ -971,7 +971,7 @@ else { printf("Unable to bind symbol %s\n", symbolName); - getc(); + getchar(); } break; } @@ -1102,7 +1102,7 @@ #if CONFIG_MODULE_DEBUG //print_hook_list(); - //getc(); + //getchar(); #endif } @@ -1149,7 +1149,7 @@ void dyld_stub_binder() { printf("ERROR: dyld_stub_binder was called, should have been take care of by the linker.\n"); - getc(); + getchar(); } #else /* CONFIG_MODULES */ Index: trunk/i386/boot2/gui.c =================================================================== --- trunk/i386/boot2/gui.c (revision 924) +++ trunk/i386/boot2/gui.c (revision 925) @@ -1579,7 +1579,7 @@ updateVRAM(); - key = getc(); + key = getchar(); if( key == kUpArrowkey ) if( currentline > 0 ) Index: trunk/i386/boot2/ramdisk.c =================================================================== --- trunk/i386/boot2/ramdisk.c (revision 924) +++ trunk/i386/boot2/ramdisk.c (revision 925) @@ -290,7 +290,7 @@ setCursorPosition(0, 0, 1); showInfoRAMDisk(); printf("\n\nPress any key to continue.\n"); - getc(); + getchar(); setActiveDisplayPage(0); } else @@ -303,7 +303,7 @@ printf("\n?rd m - mount ramdisk image\n?rd u - unmount ramdisk image"); printf("\n?rd e - enable bt(0,0) alias\n?rd d - disable bt(0,0) alias"); printf("\n\nPress any key to continue.\n"); - getc(); + getchar(); setActiveDisplayPage(0); } } Index: trunk/i386/boot2/options.c =================================================================== --- trunk/i386/boot2/options.c (revision 924) +++ trunk/i386/boot2/options.c (revision 925) @@ -911,7 +911,7 @@ // reset cursor co-ords gui.debug.cursor = pos( gui.screen.width - 160 , 10 ); } - key = getc(); + key = getchar(); updateMenu( key, (void **) &menuBVR ); newShowPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot); @@ -1383,7 +1383,7 @@ printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : ""); } - c = getc(); + c = getchar(); if (c == 'q' || c == 'Q') { break; } @@ -1450,7 +1450,7 @@ printf("Typical boot devices are 80 (First HD), 81 (Second HD)\n"); printf("Enter two-digit hexadecimal boot device [%02x]: ", bootdevice); do { - key = getc(); + key = getchar(); switch (key & kASCIIKeyMask) { case kBackspaceKey: if (digitsI > 0) { @@ -1501,7 +1501,7 @@ bool promptForRescanOption(void) { printf("\nWould you like to enable media rescan option?\nPress ENTER to enable or any key to skip.\n"); - if (getc() == kReturnKey) { + if (getchar() == kReturnKey) { return true; } else { return false; Index: trunk/i386/modules/include/types.h =================================================================== --- trunk/i386/modules/include/types.h (revision 924) +++ trunk/i386/modules/include/types.h (revision 925) @@ -1,16 +0,0 @@ -#ifndef _TYPES_H_ -#define _TYPES_H_ - -typedef unsigned char UInt8; -typedef signed char SInt8; - -typedef unsigned short UInt16; -typedef signed short SInt16; - -typedef unsigned int UInt32; -typedef signed int SInt32; - -typedef unsigned long long UInt64; -typedef signed long long SInt64; - -#endif /* _TYPES_H_ */ \ No newline at end of file Index: trunk/i386/libsa/libsa.h =================================================================== --- trunk/i386/libsa/libsa.h (revision 924) +++ trunk/i386/libsa/libsa.h (revision 925) @@ -93,7 +93,7 @@ extern int strncmp(const char * s1, const char * s2, size_t n); extern char * strcpy(char * s1, const char * s2); extern char * strncpy(char * s1, const char * s2, size_t n); -extern char * strlcpy(char * s1, const char * s2, size_t n); +extern size_t strlcpy(char * s1, const char * s2, size_t n); extern char * strstr(const char *in, const char *str); extern int atoi(const char * str); extern int ptol(const char * str); Index: trunk/i386/libsa/string.c =================================================================== --- trunk/i386/libsa/string.c (revision 924) +++ trunk/i386/libsa/string.c (revision 925) @@ -165,14 +165,13 @@ return ret; } -char * +size_t strlcpy(char * s1, const char * s2, size_t n) { - register char *ret = s1; while (n && (*s1++ = *s2++)) n--; if (!n) *--s1=0; - return ret; + return strlen(s2); } char * Index: trunk/Make.rules =================================================================== --- trunk/Make.rules (revision 924) +++ trunk/Make.rules (revision 925) @@ -16,18 +16,11 @@ NASM = $(shell which nasm) -p $(SRCROOT)/autoconf.inc -# CFLAGS = -O $(MORECPP) -arch i386 -g -CFLAGS = $(CONFIG_OPTIMIZATION_LEVEL) $(MORECPP) -g -Wmost -Werror -CPPFLAGS = -fno-exceptions -fno-rtti +CFLAGS = $(CONFIG_OPTIMIZATION_LEVEL) -g -Wmost -Werror +CPPFLAGS = $(MORECPP) -g -Wmost -Werror -fno-exceptions -fno-rtti DEFINES= -CONFIG = hd -#LIBDIR = libsa -#INC = -I. -I$(LIBDIR) - - - # # Common makefile targets. # @@ -76,24 +69,11 @@ -MD -dependency-file $(OBJROOT)/$*.d @md -u $(OBJROOT)/Makedep -f -d $(OBJROOT)/$*.d - -#$(OBJROOT)/.s.o: -# @echo "\t[AS] $<" -# @cc $(CPPFLAGS) -c $(INC) -arch i386 -o $(OBJROOT)/$(@F) $< - -# This breaks make, must use make all (FIXME) $(OBJROOT)/boot2.o: @echo "\t[AS] boot2.s" @cc $(CPPFLAGS) -Wa,-n -c $(INC) -arch i386 -o $(OBJROOT)/$(@F) boot2.s \ -MD -dependency-file $*.d @md -u $(OBJROOT)/Makedep -f -d $*.d - -#$(OBJROOT)/boot_modules.o: -# @echo "\t[AS] boot_modules.s" -# @cc $(CPPFLAGS) -Wa,-n -c $(INC) -arch i386 -o $(OBJROOT)/$(@F) $(SYMROOT)/boot_modules.s \ -# -MD -dependency-file $*.d -# @md -u $(OBJROOT)/Makedep -f -d $*.d - $(OBJROOT)/%.o: %.s @echo "\t[AS] $<"