macos 10.6 warning fixes
authorDerrick Brashear <shadow@dementia.org>
Mon, 28 Sep 2009 13:21:59 +0000 (09:21 -0400)
committerDerrick Brashear <shadow|account-1000005@unknown>
Mon, 28 Sep 2009 13:39:20 +0000 (06:39 -0700)
due to 32/64 and a newer compiler, macos 10.6 finds more warnings.
these are fixes for some of them.

Reviewed-on: http://gerrit.openafs.org/533
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 files changed:
src/butc/dump.c
src/des/make_fp.c
src/des/make_ip.c
src/des/read_pssword.c
src/kauth/admin_tools.c
src/kauth/ka-forwarder.c
src/kauth/kaprocs.c
src/kauth/kaserver.c
src/lwp/lwp.c
src/ptserver/ptserver.c
src/vol/fssync-debug.c
src/vol/salvager.c

index 60975bc..5a1228c 100644 (file)
@@ -299,9 +299,9 @@ dumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr)
        /* Create and Write the volume header */
        makeVolumeHeader(&hostVolumeHeader, dparamsPtr, fragmentNumber);
        hostVolumeHeader.contd = ((fragmentNumber == 1) ? 0 : TC_VOLCONTD);
-       volumeHeader_hton(&hostVolumeHeader, buffer);
+       volumeHeader_hton(&hostVolumeHeader, (struct volumeHeader *)buffer);
 
-       rc = butm_WriteFileData(tapeInfoPtr, buffer, 1,
+       rc = butm_WriteFileData(tapeInfoPtr, (struct volumeHeader *)buffer, 1,
                                sizeof(hostVolumeHeader));
        if (rc) {
            ErrorLog(1, taskId, rc, tapeInfoPtr->error,
@@ -644,10 +644,10 @@ xbsaDumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr)
     /* Create and Write the volume header */
     makeVolumeHeader(&hostVolumeHeader, dparamsPtr, 1);
     hostVolumeHeader.contd = 0;
-    volumeHeader_hton(&hostVolumeHeader, buffer);
+    volumeHeader_hton(&hostVolumeHeader, (struct volumeHeader *)buffer);
 
-    rc = xbsa_WriteObjectData(&butxInfo, buffer, sizeof(struct volumeHeader),
-                             &bytesWritten);
+    rc = xbsa_WriteObjectData(&butxInfo, (struct volumeHeader *)buffer,
+                             sizeof(struct volumeHeader), &bytesWritten);
     if (rc != XBSA_SUCCESS) {
        ErrorLog(1, taskId, rc, 0,
                 "Unable to write VolumeHeader data to the server\n");
index 74e8b74..211e0f9 100644 (file)
@@ -46,7 +46,7 @@ gen(FILE * stream)
 
 #ifdef AFS_DARWIN80_ENV
   for(j = 0;; j++) {
-    fprintf(stream, _darwin_whichstr[j]);
+    fprintf(stream, "%s", _darwin_whichstr[j]);
     if (j == 2)
        break;
 #endif /* AFS_DARWIN80_ENV */
index 5d699bb..2fed60e 100644 (file)
@@ -40,7 +40,7 @@ gen(FILE * stream)
 
 #ifdef AFS_DARWIN80_ENV
   for(j = 0;; j++) {
-    fprintf(stream, _darwin_whichstr[j]);
+    fprintf(stream, "%s", _darwin_whichstr[j]);
     if (j == 2)
        break;
 #endif /* AFS_DARWIN80_ENV */
index 18fa9e0..de4b43a 100644 (file)
@@ -250,7 +250,7 @@ des_read_pw_string(char *s, int maxa, char *prompt, int verify)
 #endif
 #endif
     while (!ok) {
-       (void)printf(prompt);
+       (void)printf("%s", prompt);
        (void)fflush(stdout);
 #ifdef CROSSMSDOS
        h19line(s, sizeof(s), 0);
index 982c128..4584264 100644 (file)
@@ -1290,7 +1290,8 @@ static int
 MyBeforeProc(struct cmd_syndesc *as, void *arock)
 {
     struct ktc_encryptionKey key;
-    struct ktc_principal auth_server, auth_token, client;
+    struct ktc_principal auth_server, client;
+    struct ktc_token auth_token;
     char realm[MAXKTCREALMLEN];
 
     struct ktc_token token, *pToken;
index 3bfa4b1..f894353 100644 (file)
@@ -207,7 +207,8 @@ main(int argc, char **argv)
     for (;;) {
        char buf[BUFFER_SIZE], *bufp, *sendptr;
        struct sockaddr_in from, reply, *to;
-       size_t fromlen, sendlen;
+       size_t sendlen;
+       socklen_t fromlen;
 
        bufp = buf + 8;
        fromlen = sizeof(from);
index ec23611..c2deadc 100644 (file)
@@ -299,7 +299,7 @@ init_kaprocs(const char *lclpath, int initFlags)
        return code;
     }
 
-    kaux_opendb(lclpath);      /* aux database stores failure counters */
+    kaux_opendb((char *)lclpath);/* aux database stores failure counters */
     rebuildDatabase = 0;       /* only do this during init */
     kaprocsInited = 1;
     return 0;
index 4606202..cce632e 100644 (file)
@@ -384,11 +384,11 @@ main(int argc, char *argv[])
     if (servers)
        code =
            ubik_ServerInit(myHost, htons(AFSCONF_KAUTHPORT), serverList,
-                           dbpath, &KA_dbase);
+                           (char *)dbpath, &KA_dbase);
     else
        code =
            ubik_ServerInitByInfo(myHost, htons(AFSCONF_KAUTHPORT), &cellinfo,
-                                 clones, dbpath, &KA_dbase);
+                                 clones, (char *)dbpath, &KA_dbase);
 
     if (code) {
        afs_com_err(whoami, code, "Ubik init failed");
index 66eb744..0fe7514 100644 (file)
@@ -934,9 +934,9 @@ Dispatcher(void)
 #endif
        printf("stackcheck = %u: stack = %u \n", lwp_cpptr->stackcheck,
               *(int *)lwp_cpptr->stack);
-       printf("topstack = 0x%x: stackptr = 0x%x: stacksize = 0x%x\n",
-              (uintptr_t)lwp_cpptr->context.topstack, 
-              (uintptr_t)lwp_cpptr->stack,
+       printf("topstack = 0x%" AFS_PTR_FMT ": stackptr = 0x%" AFS_PTR_FMT ": stacksize = 0x%x\n",
+              (void *)(uintptr_t)lwp_cpptr->context.topstack,
+              (void *)(uintptr_t)lwp_cpptr->stack,
               lwp_cpptr->stacksize);
 
        switch (lwp_overflowAction) {
index 4b046e9..0a764ba 100644 (file)
@@ -522,7 +522,7 @@ main(int argc, char **argv)
 
     code =
        ubik_ServerInitByInfo(myHost, htons(AFSCONF_PROTPORT), &info, clones,
-                             pr_dbaseName, &dbase);
+                             (char *)pr_dbaseName, &dbase);
     if (code) {
        afs_com_err(whoami, code, "Ubik init failed");
        PT_EXIT(2);
index 126e5c7..304b93a 100644 (file)
@@ -1046,7 +1046,7 @@ VnQuery(struct cmd_syndesc * as, void * rock)
        }
 #endif /* !AFS_DEMAND_ATTACH_FS */
 
-       printf("\twriter          = %u\n", (uintptr_t)v.writer);
+       printf("\twriter          = %"AFS_PTR_FMT"\n", (uintptr_t)v.writer);
        printf("\tvcp             = %p\n", v.vcp);
        printf("\thandle          = %p\n", v.handle);
 
index d10130d..5a93a5f 100644 (file)
@@ -268,7 +268,7 @@ handleit(struct cmd_syndesc *as, void *arock)
     }
 
     if ((ti = as->parms[18].items)) {  /* -datelogs */
-       TimeStampLogFile(AFSDIR_SERVER_SLVGLOG_FILEPATH);
+      TimeStampLogFile((char *)AFSDIR_SERVER_SLVGLOG_FILEPATH);
     }
 #endif
 
@@ -410,7 +410,7 @@ main(int argc, char **argv)
         * multiple salvagers appending to the log.
         */
 
-       CheckLogFile(AFSDIR_SERVER_SLVGLOG_FILEPATH);
+       CheckLogFile((char *)AFSDIR_SERVER_SLVGLOG_FILEPATH);
 #ifndef AFS_NT40_ENV
 #ifdef AFS_LINUX20_ENV
        fcntl(fileno(logFile), F_SETFL, O_APPEND);      /* Isn't this redundant? */