char *key;
};
-static int dummy; /* non-null ptr used for flag existence */
+static struct cmd_item dummy; /* non-null ptr used for flag existence */
static struct cmd_syndesc *allSyntax = 0;
static int noOpcodes = 0;
static int (*beforeProc) (struct cmd_syndesc * ts, void *beforeRock) = NULL;
return (CMD_INTERNALERROR);
}
if (ts->parms[j].type == CMD_FLAG) {
- ts->parms[j].items = (struct cmd_item *)&dummy;
+ ts->parms[j].items = &dummy;
} else {
positional = 0;
curType = j;
fprintf(stderr,
"WARNING: Server doesn't support retrieval of Rx statistics\n");
} else {
- struct rx_statistics rxstats;
+ union {
+ struct rx_statistics rxstats;
+ struct rx_debugIn debug;
+ } packet;
/* should gracefully handle the case where rx_stats grows */
code =
- rx_GetServerStats(s, host, port, &rxstats,
+ rx_GetServerStats(s, host, port, &packet.rxstats,
&supportedStatValues);
if (code < 0) {
printf("rxstats call failed with code %d\n", code);
exit(1);
}
- if (code != sizeof(rxstats)) {
- if ((((struct rx_debugIn *)(&rxstats))->type ==
- RX_DEBUGI_BADTYPE))
+ if (code != sizeof(packet.rxstats)) {
+ if (packet.debug.type == RX_DEBUGI_BADTYPE)
goto noRxStats;
printf
("WARNING: returned Rx statistics of unexpected size (got %d)\n",
/* handle other versions?... */
}
- rx_PrintTheseStats(stdout, &rxstats, sizeof(rxstats),
+ rx_PrintTheseStats(stdout, &packet.rxstats, sizeof(packet.rxstats),
tstats.nFreePackets, tstats.version);
}
}
afs_int32 got_no_time = 0, code;
if (!uuid_init_done) {
- uuid_time_t t;
- u_short *seedp, seed = 0;
+ union {
+ uuid_time_t t;
+ u_short seed[4];
+ } uuid_time;
+ u_short seed = 0;
rand_m = 971;;
rand_ia = 11113;
rand_ib = 104322;
* independent. Then for good measure to ensure a unique seed when there
* are multiple processes creating UUID's on a system, we add in the PID.
*/
- uuid__get_os_time(&t);
- seedp = (u_short *) (&t);
- seed ^= *seedp++;
- seed ^= *seedp++;
- seed ^= *seedp++;
- seed ^= *seedp++;
+ uuid__get_os_time(&uuid_time.t);
+ seed ^= uuid_time.seed[0];
+ seed ^= uuid_time.seed[1];
+ seed ^= uuid_time.seed[2];
+ seed ^= uuid_time.seed[3];
#if defined(KERNEL) && defined(AFS_XBSD_ENV)
rand_irand += seed + (afs_uint32) curproc->p_pid;
#else