[gq-commit] gq/src configfile.c,1.42,1.43 configfile.h,1.29,1.30 ldif.c,1.14,1.15
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2003-10-17 06:40:37
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv28868 Modified Files: configfile.c configfile.h ldif.c Log Message: * Made some static, global and unchangeable data const to express this more clearly. * Compress some data by using char (usually one byte) instead of int (4 bytes) Index: configfile.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/configfile.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** configfile.c 12 Oct 2003 11:10:41 -0000 1.42 --- configfile.c 17 Oct 2003 06:40:25 -0000 1.43 *************** *** 53,57 **** struct gq_config *config; ! struct tokenlist token_searchargument[] = { { SEARCHARG_BEGINS_WITH, "Begins with" }, { SEARCHARG_ENDS_WITH, "Ends with" }, --- 53,57 ---- struct gq_config *config; ! const struct tokenlist token_searchargument[] = { { SEARCHARG_BEGINS_WITH, "Begins with" }, { SEARCHARG_ENDS_WITH, "Ends with" }, *************** *** 61,65 **** }; ! struct tokenlist token_bindtype[] = { { BINDTYPE_SIMPLE, "Simple" }, { BINDTYPE_KERBEROS, "Kerberos"}, --- 61,65 ---- }; ! const struct tokenlist token_bindtype[] = { { BINDTYPE_SIMPLE, "Simple" }, { BINDTYPE_KERBEROS, "Kerberos"}, *************** *** 68,72 **** }; ! struct tokenlist token_ldifformat[] = { { LDIF_UMICH, "UMich" }, { LDIF_V1, "Version1" }, --- 68,72 ---- }; ! const struct tokenlist token_ldifformat[] = { { LDIF_UMICH, "UMich" }, { LDIF_V1, "Version1" }, Index: configfile.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/configfile.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** configfile.h 12 Oct 2003 05:30:41 -0000 1.29 --- configfile.h 17 Oct 2003 06:40:27 -0000 1.30 *************** *** 168,174 **** extern struct gq_config *config; ! extern struct tokenlist token_bindtype[]; ! extern struct tokenlist token_ldifformat[]; ! extern struct tokenlist token_searchargument[]; #endif --- 168,174 ---- extern struct gq_config *config; ! extern const struct tokenlist token_bindtype[]; ! extern const struct tokenlist token_ldifformat[]; ! extern const struct tokenlist token_searchargument[]; #endif Index: ldif.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/ldif.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ldif.c 28 Sep 2003 23:13:09 -0000 1.14 --- ldif.c 17 Oct 2003 06:40:27 -0000 1.15 *************** *** 1,5 **** /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2001 Bert Vermeulen This program is released under the Gnu General Public License with --- 1,6 ---- /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2003 Bert Vermeulen ! Copyright (C) 2002-2003 Peter Stamfest This program is released under the Gnu General Public License with *************** *** 183,191 **** } void b64_encode(GString *out, char *value, int vlen) { int i,j; - char ch[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; char chin[4], chout[5]; --- 184,192 ---- } + static const char ch[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; void b64_encode(GString *out, char *value, int vlen) { int i,j; char chin[4], chout[5]; *************** *** 206,210 **** j = 0; } - } --- 207,210 ---- *************** *** 214,222 **** chout[3] = '='; g_string_append(out, chout); - } ! static int decode[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --- 214,221 ---- chout[3] = '='; g_string_append(out, chout); } ! static const signed char decode[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, *************** *** 242,262 **** 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, }; --- 241,244 ---- *************** *** 288,292 **** for (i = 0 ; i < vlen ; i++) { ! c = value[i]; if (c == '=') eq++; --- 270,275 ---- for (i = 0 ; i < vlen ; i++) { ! if (value[i] & 0x80) continue; ! c = value[i] & 0x7f; if (c == '=') eq++; |