forked from github/server
indentation only
This commit is contained in:
parent
c4696fe512
commit
ced0d324e6
|
@ -46,25 +46,25 @@ mt_new(const char * name, const char * args[])
|
|||
mtype->name = strdup(name);
|
||||
mtype->nparameters = nparameters;
|
||||
if (nparameters > 0) {
|
||||
mtype->pnames = (const char**)malloc(sizeof(char*) * nparameters);
|
||||
mtype->types = (const char**)malloc(sizeof(char*) * nparameters);
|
||||
mtype->pnames = (const char**)malloc(sizeof(char*) * nparameters);
|
||||
mtype->types = (const char**)malloc(sizeof(char*) * nparameters);
|
||||
} else {
|
||||
mtype->pnames = NULL;
|
||||
mtype->types = NULL;
|
||||
mtype->pnames = NULL;
|
||||
mtype->types = NULL;
|
||||
}
|
||||
if (args!=NULL) for (i=0;args[i];++i) {
|
||||
const char * x = args[i];
|
||||
const char * spos = strchr(x, ':');
|
||||
if (spos==NULL) {
|
||||
mtype->pnames[i] = strdup(x);
|
||||
mtype->types[i] = NULL;
|
||||
} else {
|
||||
char * cp = strncpy((char*)malloc(spos-x+1), x, spos-x);
|
||||
cp[spos-x] = '\0';
|
||||
mtype->pnames[i] = cp;
|
||||
/* optimierung: Typ-Strings zentral verwalten. */
|
||||
mtype->types[i] = strdup(spos+1);
|
||||
}
|
||||
const char * x = args[i];
|
||||
const char * spos = strchr(x, ':');
|
||||
if (spos==NULL) {
|
||||
mtype->pnames[i] = strdup(x);
|
||||
mtype->types[i] = NULL;
|
||||
} else {
|
||||
char * cp = strncpy((char*)malloc(spos-x+1), x, spos-x);
|
||||
cp[spos-x] = '\0';
|
||||
mtype->pnames[i] = cp;
|
||||
/* optimierung: Typ-Strings zentral verwalten. */
|
||||
mtype->types[i] = strdup(spos+1);
|
||||
}
|
||||
}
|
||||
return mtype;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue