Struct/array initializers must be constant expressions in C89

This commit is contained in:
Hallvard Furuseth 2007-05-09 19:09:32 +00:00
parent 7b7b137832
commit d72acf7250

View File

@ -519,7 +519,7 @@ do_syncrep1(
si->si_syncCookie.sid ); si->si_syncCookie.sid );
} else { } else {
AttributeName at[2]; AttributeName at[2];
Attribute a = { slap_schema.si_ad_contextCSN }; Attribute a = {0};
Entry e = {0}; Entry e = {0};
SlapReply rs = {0}; SlapReply rs = {0};
int i, j, changed = 0; int i, j, changed = 0;
@ -530,6 +530,7 @@ do_syncrep1(
* allowed, and all changes will already be reflected in * allowed, and all changes will already be reflected in
* the cookieState. * the cookieState.
*/ */
a.a_desc = slap_schema.si_ad_contextCSN;
e.e_attrs = &a; e.e_attrs = &a;
e.e_name = si->si_wbe->be_suffix[0]; e.e_name = si->si_wbe->be_suffix[0];
e.e_nname = si->si_wbe->be_nsuffix[0]; e.e_nname = si->si_wbe->be_nsuffix[0];
@ -2081,12 +2082,14 @@ retry_add:;
/* Setup opattrs too */ /* Setup opattrs too */
{ {
AttributeDescription *opattrs[] = { static AttributeDescription *nullattr = NULL;
slap_schema.si_ad_entryCSN, static AttributeDescription **const opattrs[] = {
slap_schema.si_ad_modifiersName, &slap_schema.si_ad_entryCSN,
slap_schema.si_ad_modifyTimestamp, &slap_schema.si_ad_modifiersName,
NULL &slap_schema.si_ad_modifyTimestamp,
&nullattr
}; };
AttributeDescription *opattr;
Modifications *mod, **modtail, **ml; Modifications *mod, **modtail, **ml;
int i; int i;
@ -2097,10 +2100,10 @@ retry_add:;
modtail = &mod->sml_next; modtail = &mod->sml_next;
/* pull mod off incoming modlist, append to orr_modlist */ /* pull mod off incoming modlist, append to orr_modlist */
for ( i = 0; opattrs[i]; i++ ) { for ( i = 0; (opattr = *opattrs[i]) != NULL; i++ ) {
for ( ml = modlist; *ml; ml = &(*ml)->sml_next ) for ( ml = modlist; *ml; ml = &(*ml)->sml_next )
{ {
if ( (*ml)->sml_desc == opattrs[i] ) { if ( (*ml)->sml_desc == opattr ) {
mod = *ml; mod = *ml;
*ml = mod->sml_next; *ml = mod->sml_next;
mod->sml_next = NULL; mod->sml_next = NULL;