From: Ben Kaduk Date: Mon, 21 Jul 2014 21:30:36 +0000 (-0400) Subject: Remove some incomplete struct initializers X-Git-Tag: openafs-stable-1_8_0pre1~613 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=2ceb387191d4dced7815237c20a9b2cb577ad3df Remove some incomplete struct initializers C99 requires that objects with static linkage, which includes global variables, be initialized to zero/NULL. It is possible that old compilers required a hack of using one explicit initializer and relying on the requirement from C99 that the elements of the structure not listed in the initializer be initialized as if it had static linkage. These incomplete initializers seem to have been introduced to support old OS X compilers which are not believed to still be in use. Using a complete explicit initializer is undesired here, as the rxkad statistics structures have a great number of elements and the uuid structure is somewhat complicated. Change-Id: Iefe7842cbf874252267cb3a8aee5d90ec2cab169 Reviewed-on: http://gerrit.openafs.org/11374 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Garrett Wollman Reviewed-by: Jeffrey Altman --- diff --git a/src/rxkad/rxkad_common.c b/src/rxkad/rxkad_common.c index 3133d29..0f14e4b 100644 --- a/src/rxkad/rxkad_common.c +++ b/src/rxkad/rxkad_common.c @@ -60,11 +60,11 @@ /* variable initialization for the benefit of darwin compiler; if it causes problems elsewhere, conditionalize for darwin or fc_test compile breaks */ #ifdef AFS_PTHREAD_ENV -struct rxkad_global_stats rxkad_global_stats = { 0 }; +struct rxkad_global_stats rxkad_global_stats; pthread_mutex_t rxkad_global_stats_lock; pthread_key_t rxkad_stats_key; #else /* AFS_PTHREAD_ENV */ -struct rxkad_stats rxkad_stats = { { 0 } }; +struct rxkad_stats rxkad_stats; #endif /* AFS_PTHREAD_ENV */ #ifdef AFS_PTHREAD_ENV diff --git a/src/util/uuid.c b/src/util/uuid.c index 5aaff37..dbf77d0 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -98,7 +98,7 @@ void uuid__get_os_time(uuid_time_t * os_time); * +--------------------------...-----+ */ -afsUUID afs_uuid_g_nil_uuid = { 0 }; +afsUUID afs_uuid_g_nil_uuid; static uuid_time_t time_now, time_last; static u_short uuid_time_adjust, clock_seq; static afs_uint32 rand_m, rand_ia, rand_ib, rand_irand, uuid_init_done = 0;