Don't cast the return from calloc()
[openafs.git] / src / libadmin / vos / afs_vosAdmin.c
index 32e6512..3eba22c 100644 (file)
@@ -9,30 +9,19 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
 #include <roken.h>
 
-#include <afs/stds.h>
-#include <stdio.h>
-#include <string.h>
 #include <ctype.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <io.h>
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
-#include "afs_vosAdmin.h"
-#include "../adminutil/afs_AdminInternal.h"
+
 #include <afs/vlserver.h>
 #include <afs/volser.h>
 #include <afs/volint.h>
 
+#include "afs_vosAdmin.h"
+#include "../adminutil/afs_AdminInternal.h"
+
 /* File descriptors are HANDLE's on NT. The following typedef helps catch
  * type errors. Duplicated from vol/ihandle.h
  */
@@ -700,8 +689,7 @@ vos_PartitionGetBegin(const void *cellHandle, const void *serverHandle,
     file_server_p f_server = (file_server_p) serverHandle;
     afs_admin_iterator_p iter =
        (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    partition_get_p part =
-       (partition_get_p) calloc(1, sizeof(partition_get_t));
+    partition_get_p part = calloc(1, sizeof(partition_get_t));
 
     /*
      * Validate arguments
@@ -1347,7 +1335,7 @@ vos_FileServerGetBegin(const void *cellHandle, vos_MessageCallBack_t callBack,
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     afs_admin_iterator_p iter =
        (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    server_get_p serv = (server_get_p) calloc(1, sizeof(server_get_t));
+    server_get_p serv = calloc(1, sizeof(server_get_t));
     struct VLCallBack unused;
 
 
@@ -1686,8 +1674,7 @@ vos_ServerTransactionStatusGetBegin(const void *cellHandle,
     file_server_p f_server = (file_server_p) serverHandle;
     afs_admin_iterator_p iter =
        (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    transaction_get_p tran =
-       (transaction_get_p) calloc(1, sizeof(transaction_get_t));
+    transaction_get_p tran = calloc(1, sizeof(transaction_get_t));
 
 
     /*
@@ -2136,8 +2123,7 @@ vos_VLDBGetBegin(const void *cellHandle, const void *serverHandle,
     file_server_p f_server = (file_server_p) serverHandle;
     afs_admin_iterator_p iter =
        (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    vldb_entry_get_p entry =
-       (vldb_entry_get_p) calloc(1, sizeof(vldb_entry_get_t));
+    vldb_entry_get_p entry = calloc(1, sizeof(vldb_entry_get_t));
     struct VldbListByAttributes attr;
 
     attr.Mask = 0;
@@ -3507,7 +3493,7 @@ copyvolintXInfo(struct volintXInfo *source, vos_volumeEntry_p dest,
      * user from seeing stale data from a previous call
      */
 
-    memset(dest, 0, sizeof(dest));
+    memset(dest, 0, sizeof(*dest));
 
     switch (source->status) {
     case VOK:
@@ -3817,7 +3803,7 @@ vos_VolumeGetBegin(const void *cellHandle, const void *serverHandle,
     file_server_p f_server = (file_server_p) serverHandle;
     afs_admin_iterator_p iter =
        (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    volume_get_p entry = (volume_get_p) calloc(1, sizeof(volume_get_t));
+    volume_get_p entry = calloc(1, sizeof(volume_get_t));
 
     /*
      * Validate arguments