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->name = strdup(name);
|
||||||
mtype->nparameters = nparameters;
|
mtype->nparameters = nparameters;
|
||||||
if (nparameters > 0) {
|
if (nparameters > 0) {
|
||||||
mtype->pnames = (const char**)malloc(sizeof(char*) * nparameters);
|
mtype->pnames = (const char**)malloc(sizeof(char*) * nparameters);
|
||||||
mtype->types = (const char**)malloc(sizeof(char*) * nparameters);
|
mtype->types = (const char**)malloc(sizeof(char*) * nparameters);
|
||||||
} else {
|
} else {
|
||||||
mtype->pnames = NULL;
|
mtype->pnames = NULL;
|
||||||
mtype->types = NULL;
|
mtype->types = NULL;
|
||||||
}
|
}
|
||||||
if (args!=NULL) for (i=0;args[i];++i) {
|
if (args!=NULL) for (i=0;args[i];++i) {
|
||||||
const char * x = args[i];
|
const char * x = args[i];
|
||||||
const char * spos = strchr(x, ':');
|
const char * spos = strchr(x, ':');
|
||||||
if (spos==NULL) {
|
if (spos==NULL) {
|
||||||
mtype->pnames[i] = strdup(x);
|
mtype->pnames[i] = strdup(x);
|
||||||
mtype->types[i] = NULL;
|
mtype->types[i] = NULL;
|
||||||
} else {
|
} else {
|
||||||
char * cp = strncpy((char*)malloc(spos-x+1), x, spos-x);
|
char * cp = strncpy((char*)malloc(spos-x+1), x, spos-x);
|
||||||
cp[spos-x] = '\0';
|
cp[spos-x] = '\0';
|
||||||
mtype->pnames[i] = cp;
|
mtype->pnames[i] = cp;
|
||||||
/* optimierung: Typ-Strings zentral verwalten. */
|
/* optimierung: Typ-Strings zentral verwalten. */
|
||||||
mtype->types[i] = strdup(spos+1);
|
mtype->types[i] = strdup(spos+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mtype;
|
return mtype;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue