Clean up warnings in libadmin/bos/afs_bosAdmin.c
authorRuss Allbery <rra@stanford.edu>
Thu, 27 May 2010 17:33:57 +0000 (12:33 -0500)
committerDerrick Brashear <shadow@dementia.org>
Fri, 28 May 2010 02:46:47 +0000 (19:46 -0700)
Use the correct data structures for BOS timestamps.  Use afs_int32 for
the expressed timestamps for executables since that's what the BOS RPC
says it's using for right now; we should change this, but when we do,
warnings will catch this use along with the others.  Cast some const
char *'s that are passed into BOS functions that take char *'s.

Change-Id: Iff3a6c42241953ed086f8e739cdb344a41a44635
Reviewed-on: http://gerrit.openafs.org/2050
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

README.WARNINGS
src/libadmin/bos/Makefile.in
src/libadmin/bos/afs_bosAdmin.c
src/libadmin/bos/afs_bosAdmin.h
src/libadmin/test/bos.c

index 8fe9031..2faf0ab 100644 (file)
@@ -53,7 +53,6 @@ bucoord/commands.c   : all         : Ubik_Call
 butc/tcudbprocs.c    : all          : ubik_Call
 kauth/admin_tools.c  : all           : ubik_Call nonsense
 kauth/authclient.c   : strict-proto  : ubik_Call nonsense
-libadmin/bos/afs_bosAdmin.c: all     : time types, and const
 libadmin/kas/afs_kasAdmin.c: all     : Ubik_Call nonsense
 libadmin/samples/rxstat_query_peer.c : all : util_RPCStatsStateGet types
 libadmin/samples/rxstat_query_process.c : all : util_RPCStatsStateGet types
index 2efb27d..71a3c12 100644 (file)
@@ -50,7 +50,7 @@ libbosadmin.a: ${LIBOBJS}
        ${RANLIB} $@
 
 afs_bosAdmin.o: afs_bosAdmin.c afs_bosAdmin.h
-       $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
+       $(CC) $(CFLAGS) -c $<
 
 bosint.xdr.o: ${BOZO}/bosint.xdr.c
        ${CCRULE}
index d80ed32..016145a 100644 (file)
@@ -2824,8 +2824,8 @@ bos_ExecutableRevert(const void *serverHandle, const char *execFile,
 
 int ADMINAPI
 bos_ExecutableTimestampGet(const void *serverHandle, const char *execFile,
-                          unsigned long *newTime, unsigned long *oldTime,
-                          unsigned long *bakTime, afs_status_p st)
+                          afs_int32 *newTime, afs_int32 *oldTime,
+                          afs_int32 *bakTime, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2964,7 +2964,7 @@ bos_ExecutableRestartTimeSet(const void *serverHandle, bos_Restart_t type,
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 restartType = 0;
-    struct ktime restartTime;
+    struct bozo_netKTime restartTime;
 
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutableRestartTimeSet;
@@ -3050,7 +3050,7 @@ bos_ExecutableRestartTimeGet(const void *serverHandle, bos_Restart_t type,
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 restartType = 0;
-    struct ktime restartTime;
+    struct bozo_netKTime restartTime;
 
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutableRestartTimeGet;
@@ -3154,7 +3154,7 @@ bos_LogGet(const void *serverHandle, const char *log,
 
     tcall = rx_NewCall(b_handle->server);
     have_call = 1;
-    tst = StartBOZO_GetLog(tcall, log);
+    tst = StartBOZO_GetLog(tcall, (char *) log);
 
     if (tst != 0) {
        goto fail_bos_LogGet;
@@ -3295,7 +3295,7 @@ bos_CommandExecute(const void *serverHandle, const char *command,
        goto fail_bos_CommandExecute;
     }
 
-    tst = BOZO_Exec(b_handle->server, command);
+    tst = BOZO_Exec(b_handle->server, (char *) command);
 
     if (tst == 0) {
        rc = 1;
index 79d9bba..c853850 100644 (file)
@@ -294,9 +294,9 @@ extern int ADMINAPI bos_ExecutableRevert(const void *serverHandle,
 
 extern int ADMINAPI bos_ExecutableTimestampGet(const void *serverHandle,
                                               const char *execFile,
-                                              unsigned long *newTime,
-                                              unsigned long *oldTime,
-                                              unsigned long *bakTime,
+                                              afs_int32 *newTime,
+                                              afs_int32 *oldTime,
+                                              afs_int32 *bakTime,
                                               afs_status_p st);
 
 extern int ADMINAPI bos_ExecutablePrune(const void *serverHandle,
index b7373e1..3b283b3 100644 (file)
@@ -1363,9 +1363,9 @@ DoBosExecutableTimestampGet(struct cmd_syndesc *as, void *arock)
     afs_status_t st = 0;
     void *bos_server = NULL;
     const char *executable = NULL;
-    unsigned long new_time = 0;
-    unsigned long old_time = 0;
-    unsigned long bak_time = 0;
+    afs_int32 new_time = 0;
+    afs_int32 old_time = 0;
+    afs_int32 bak_time = 0;
 
     if (as->parms[SERVER].items) {
        if (!bos_ServerOpen