Mac: Fix compiler warnings

svn path=/trunk/boinc/; revision=13958
This commit is contained in:
Charlie Fenton 2007-10-25 09:34:16 +00:00
parent 8da306d4d8
commit 06012437a6
3 changed files with 9 additions and 5 deletions

View File

@ -35,6 +35,7 @@
#define CREATE_LOG 0
#if CREATE_LOG
#ifdef __cplusplus
extern "C" {
#endif
@ -44,6 +45,7 @@ static void print_to_log_file(const char *format, ...);
static void strip_cr(char *buf);
#endif
#endif // if CREATE_LOG
int main(int argc, char** argv) {
passwd *pw;
@ -126,8 +128,8 @@ int main(int argc, char** argv) {
}
static void print_to_log_file(const char *format, ...) {
#if CREATE_LOG
static void print_to_log_file(const char *format, ...) {
FILE *f;
va_list args;
char buf[256];
@ -153,10 +155,8 @@ static void print_to_log_file(const char *format, ...) {
fputs("\n", f);
fflush(f);
fclose(f);
#endif
}
#if CREATE_LOG
static void strip_cr(char *buf)
{
char *theCR;

View File

@ -188,7 +188,7 @@ int create_shmem_mmap(char *path, size_t size, void** pp) {
retval = fstat(fd, &sbuf);
if (retval) return ERR_SHMGET;
if (sbuf.st_size < size) {
if (sbuf.st_size < (long)size) {
// The following 2 lines extend the file and clear its new
// area to all zeros because they write beyond the old EOF.
// See the lseek man page for details.

View File

@ -44,7 +44,7 @@ static void DeleteLoginItem(void);
static char * PersistentFGets(char *buf, size_t buflen, FILE *f);
static pid_t FindProcessPID(char* name, pid_t thePID);
static OSStatus QuitBOINCManager(OSType signature);
static void SleepTicks(UInt32 ticksToSleep);
//static void SleepTicks(UInt32 ticksToSleep);
static Boolean ShowMessage(Boolean allowCancel, const char *format, ...);
@ -217,6 +217,8 @@ static OSStatus DoUninstall(void) {
system ("dscl . -delete /groups/boinc_master");
system ("dscl . -delete /users/boinc_project");
system ("dscl . -delete /groups/boinc_project");
return 0;
}
@ -662,6 +664,7 @@ bail:
return err;
}
#if 0
// Uses usleep to sleep for full duration even if a signal is received
static void SleepTicks(UInt32 ticksToSleep) {
UInt32 endSleep, timeNow, ticksRemaining;
@ -675,6 +678,7 @@ static void SleepTicks(UInt32 ticksToSleep) {
ticksRemaining = endSleep - timeNow;
}
}
#endif
static Boolean ShowMessage(Boolean allowCancel, const char *format, ...) {