From fc8b21401978bf891fbd13855ac6c8b1f07bae3c Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Wed, 2 Feb 2011 05:26:20 +0000 Subject: Explicitly define ZNotice_Kind constants + actually define the promised strings Since these are constants used in the protocol be explicit about what values the C compiler is assigning them, and that they can't be arbitrarily rearranged. Also, since we were promising strings for describing them in zephyr.h actually define the array. --- h/zephyr/zephyr.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'h') diff --git a/h/zephyr/zephyr.h b/h/zephyr/zephyr.h index ac42bb0..f23bb19 100644 --- a/h/zephyr/zephyr.h +++ b/h/zephyr/zephyr.h @@ -59,9 +59,10 @@ typedef char ZPacket_t[Z_MAXPKTLEN]; /* Packet type */ typedef enum { - UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT + UNSAFE = 0, UNACKED = 1, ACKED = 2, HMACK = 3, HMCTL = 4, SERVACK = 5, + SERVNAK = 6, CLIENTACK = 7, STAT = 8 } ZNotice_Kind_t; -extern const char *ZNoticeKinds[9]; +extern const char * const ZNoticeKinds[9]; struct _ZTimeval { int tv_sec; -- cgit v1.2.3