indentation only

This commit is contained in:
Enno Rehling 2005-05-07 10:03:00 +00:00
parent c4696fe512
commit ced0d324e6
1 changed files with 16 additions and 16 deletions

View File

@ -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;
}