Commit 322fb7fb authored by Bernhard Link's avatar Bernhard Link

make strlist_init void

parent e307b3dc
2006-09-20 Bernhard R. Link <brlink@debian.org>
* make strlist_init void
2006-09-19 Bernhard R. Link <brlink@debian.org>
* rename modifychanges to changestool
......
......@@ -265,9 +265,7 @@ retvalue chunk_getextralinelist(const char *chunk,const char *name,struct strlis
f = chunk_getfield(name,chunk);
if( f == NULL )
return RET_NOTHING;
r = strlist_init(strlist);
if( RET_WAS_ERROR(r) )
return r;
strlist_init(strlist);
/* walk over the first line */
while( *f != '\0' && *f != '\n' )
f++;
......@@ -343,9 +341,7 @@ retvalue chunk_getwordlist(const char *chunk,const char *name,struct strlist *st
f = chunk_getfield(name,chunk);
if( f == NULL )
return RET_NOTHING;
r = strlist_init(strlist);
if( RET_WAS_ERROR(r) )
return r;
strlist_init(strlist);
while( *f != '\0' ) {
/* walk over spaces */
while( *f != '\0' && xisspace(*f) ) {
......
......@@ -2101,11 +2101,10 @@ static retvalue callaction(const struct action *action,int argc,const char *argv
if( deletederef ) {
assert( ISSET(action->needs,NEED_REFERENCES) );
assert( ISSET(action->needs,NEED_REFERENCES) );
result = strlist_init(&dereferencedfilekeys);
strlist_init(&dereferencedfilekeys);
}
assert( result != RET_NOTHING );
if( RET_IS_OK(result) && !interrupted() ) {
if( !interrupted() ) {
result = action->start(references,filesdb,
deletederef?&dereferencedfilekeys:NULL,
argc,argv);
......
......@@ -718,15 +718,8 @@ retvalue splitlist(struct strlist *from,
retvalue r;
int i;
r = strlist_init(from);
if( RET_WAS_ERROR(r) ) {
return r;
}
r = strlist_init(into);
if( RET_WAS_ERROR(r) ) {
strlist_done(from);
return r;
}
strlist_init(from);
strlist_init(into);
/* * Iterator over components to update * */
r = RET_NOTHING;
......
......@@ -19,6 +19,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <zlib.h>
#include "error.h"
#include "names.h"
......@@ -62,11 +63,7 @@ retvalue release_getchecksums(const char *releasefile,struct strlist *info) {
if( RET_WAS_ERROR(r) )
return r;
r = strlist_init(&checksuminfo);
if( RET_WAS_ERROR(r) ) {
strlist_done(&files);
return r;
}
strlist_init(&checksuminfo);
for( i = 0 ; i < files.count ; i++ ) {
r = calc_parsefileline(files.values[i],&filename,&md5sum);
......
......@@ -371,9 +371,7 @@ static retvalue checksigs(/*@null@*/ /*@out@*/struct strlist *validkeys) {
bool_t goodsignature = FALSE;
if( validkeys != NULL ) {
r = strlist_init(&fingerprints);
if( RET_WAS_ERROR(r) )
return r;
strlist_init(&fingerprints);
}
idx = 0;
while( (fingerprint = gpgme_get_sig_status(context,idx,&sigstat,NULL)) != NULL ) {
......
......@@ -99,14 +99,12 @@ retvalue strlist_init_singleton(char *value,struct strlist *strlist) {
return RET_OK;
}
retvalue strlist_init(struct strlist *strlist) {
void strlist_init(struct strlist *strlist) {
assert(strlist != NULL);
strlist->count = 0;
strlist->size = 0;
strlist->values = NULL;
return RET_OK;
}
void strlist_done(struct strlist *strlist) {
......
......@@ -15,7 +15,7 @@ struct strlist {
int count,size;
};
retvalue strlist_init(/*@out@*/struct strlist *strlist);
void strlist_init(/*@out@*/struct strlist *strlist);
retvalue strlist_init_n(int startsize,/*@out@*/struct strlist *strlist);
retvalue strlist_init_singleton(/*@only@*/char *value,/*@out@*/struct strlist *strlist);
void strlist_done(struct strlist *strlist);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment