Fix code style
This commit is contained in:
parent
15db72d54d
commit
b6177aa678
|
|
@ -410,9 +410,9 @@ int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Copy field data from original field
|
// Copy field data from original field
|
||||||
int nameLength = c - lastStart;
|
int nameLength = c - lastStart;
|
||||||
MemoryCopy(structs[i].fieldName[structs[i].fieldCount], &(structs[i].fieldName[originalIndex][lastStart]), nameLength);
|
MemoryCopy(structs[i].fieldName[structs[i].fieldCount], &structs[i].fieldName[originalIndex][lastStart], nameLength);
|
||||||
MemoryCopy(structs[i].fieldType[structs[i].fieldCount], &(structs[i].fieldType[originalIndex][0]), TextLength(structs[i].fieldType[originalIndex]));
|
MemoryCopy(structs[i].fieldType[structs[i].fieldCount], &structs[i].fieldType[originalIndex][0], TextLength(structs[i].fieldType[originalIndex]));
|
||||||
MemoryCopy(structs[i].fieldDesc[structs[i].fieldCount], &(structs[i].fieldDesc[originalIndex][0]), TextLength(structs[i].fieldDesc[originalIndex]));
|
MemoryCopy(structs[i].fieldDesc[structs[i].fieldCount], &structs[i].fieldDesc[originalIndex][0], TextLength(structs[i].fieldDesc[originalIndex]));
|
||||||
structs[i].fieldCount++;
|
structs[i].fieldCount++;
|
||||||
}
|
}
|
||||||
if (!isEndOfString)
|
if (!isEndOfString)
|
||||||
|
|
@ -440,7 +440,7 @@ int main(int argc, char* argv[])
|
||||||
if (additionalFields > 0) {
|
if (additionalFields > 0) {
|
||||||
// Copy original name to last additional field
|
// Copy original name to last additional field
|
||||||
structs[i].fieldCount += additionalFields;
|
structs[i].fieldCount += additionalFields;
|
||||||
MemoryCopy(structs[i].fieldName[originalIndex + additionalFields], &(structs[i].fieldName[originalIndex][0]), TextLength(structs[i].fieldName[originalIndex]));
|
MemoryCopy(structs[i].fieldName[originalIndex + additionalFields], &structs[i].fieldName[originalIndex][0], TextLength(structs[i].fieldName[originalIndex]));
|
||||||
|
|
||||||
// Copy names from type to additional fields
|
// Copy names from type to additional fields
|
||||||
int fieldsRemaining = additionalFields;
|
int fieldsRemaining = additionalFields;
|
||||||
|
|
@ -456,7 +456,7 @@ int main(int argc, char* argv[])
|
||||||
if (fieldsRemaining != additionalFields)
|
if (fieldsRemaining != additionalFields)
|
||||||
{
|
{
|
||||||
nameStart = k + 1;
|
nameStart = k + 1;
|
||||||
MemoryCopy(structs[i].fieldName[originalIndex + fieldsRemaining], &(structs[i].fieldType[originalIndex][nameStart]), nameEnd - nameStart + 1);
|
MemoryCopy(structs[i].fieldName[originalIndex + fieldsRemaining], &structs[i].fieldType[originalIndex][nameStart], nameEnd - nameStart + 1);
|
||||||
}
|
}
|
||||||
nameEnd = -1;
|
nameEnd = -1;
|
||||||
fieldsRemaining--;
|
fieldsRemaining--;
|
||||||
|
|
@ -472,8 +472,8 @@ int main(int argc, char* argv[])
|
||||||
// Set field type and description of additional fields
|
// Set field type and description of additional fields
|
||||||
for (int j = 1; j <= additionalFields; j++)
|
for (int j = 1; j <= additionalFields; j++)
|
||||||
{
|
{
|
||||||
MemoryCopy(structs[i].fieldType[originalIndex + j], &(structs[i].fieldType[originalIndex][0]), fieldTypeLength);
|
MemoryCopy(structs[i].fieldType[originalIndex + j], &structs[i].fieldType[originalIndex][0], fieldTypeLength);
|
||||||
MemoryCopy(structs[i].fieldDesc[originalIndex + j], &(structs[i].fieldDesc[originalIndex][0]), TextLength(structs[i].fieldDesc[originalIndex]));
|
MemoryCopy(structs[i].fieldDesc[originalIndex + j], &structs[i].fieldDesc[originalIndex][0], TextLength(structs[i].fieldDesc[originalIndex]));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -503,7 +503,7 @@ int main(int argc, char* argv[])
|
||||||
int typeStart = c;
|
int typeStart = c;
|
||||||
while(linePtr[c] != ' ') c++;
|
while(linePtr[c] != ' ') c++;
|
||||||
int typeLen = c - typeStart;
|
int typeLen = c - typeStart;
|
||||||
MemoryCopy(aliases[i].type, linePtr + typeStart, typeLen);
|
MemoryCopy(aliases[i].type, &linePtr[typeStart], typeLen);
|
||||||
|
|
||||||
// Skip space
|
// Skip space
|
||||||
c++;
|
c++;
|
||||||
|
|
@ -512,10 +512,10 @@ int main(int argc, char* argv[])
|
||||||
int nameStart = c;
|
int nameStart = c;
|
||||||
while(linePtr[c] != ';') c++;
|
while(linePtr[c] != ';') c++;
|
||||||
int nameLen = c - nameStart;
|
int nameLen = c - nameStart;
|
||||||
MemoryCopy(aliases[i].name, linePtr + nameStart, nameLen);
|
MemoryCopy(aliases[i].name, &linePtr[nameStart], nameLen);
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
GetDescription(linePtr + c, aliases[i].desc);
|
GetDescription(&linePtr[c], aliases[i].desc);
|
||||||
}
|
}
|
||||||
free(aliasLines);
|
free(aliasLines);
|
||||||
|
|
||||||
|
|
@ -565,7 +565,7 @@ int main(int argc, char* argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
GetDescription(linePtr + c, callbacks[i].desc);
|
GetDescription(&linePtr[c], callbacks[i].desc);
|
||||||
}
|
}
|
||||||
free(callbackLines);
|
free(callbackLines);
|
||||||
|
|
||||||
|
|
@ -709,7 +709,7 @@ int main(int argc, char* argv[])
|
||||||
bool isDuplicate = false;
|
bool isDuplicate = false;
|
||||||
for (int k = 0; k < defineIndex; k++)
|
for (int k = 0; k < defineIndex; k++)
|
||||||
{
|
{
|
||||||
if ((nameLen == TextLength(defines[k].name)) && IsTextEqual(defines[k].name, linePtr + defineNameStart, nameLen))
|
if ((nameLen == TextLength(defines[k].name)) && IsTextEqual(defines[k].name, &linePtr[defineNameStart], nameLen))
|
||||||
{
|
{
|
||||||
isDuplicate = true;
|
isDuplicate = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -717,7 +717,7 @@ int main(int argc, char* argv[])
|
||||||
}
|
}
|
||||||
if (isDuplicate) continue;
|
if (isDuplicate) continue;
|
||||||
|
|
||||||
MemoryCopy(defines[defineIndex].name, linePtr + defineNameStart, nameLen);
|
MemoryCopy(defines[defineIndex].name, &linePtr[defineNameStart], nameLen);
|
||||||
|
|
||||||
// Determine type
|
// Determine type
|
||||||
if (linePtr[defineNameEnd] == ')') defines[defineIndex].type = MACRO;
|
if (linePtr[defineNameEnd] == ')') defines[defineIndex].type = MACRO;
|
||||||
|
|
@ -769,7 +769,7 @@ int main(int argc, char* argv[])
|
||||||
int valueLen = defineValueEnd - defineValueStart + 1;
|
int valueLen = defineValueEnd - defineValueStart + 1;
|
||||||
if (valueLen > 255) valueLen = 255;
|
if (valueLen > 255) valueLen = 255;
|
||||||
|
|
||||||
if (valueLen > 0) MemoryCopy(defines[defineIndex].value, linePtr + defineValueStart, valueLen);
|
if (valueLen > 0) MemoryCopy(defines[defineIndex].value, &linePtr[defineValueStart], valueLen);
|
||||||
|
|
||||||
// Extracting description
|
// Extracting description
|
||||||
if ((linePtr[j] == '/') && linePtr[j + 1] == '/')
|
if ((linePtr[j] == '/') && linePtr[j + 1] == '/')
|
||||||
|
|
@ -782,7 +782,7 @@ int main(int argc, char* argv[])
|
||||||
int commentLen = commentEnd - commentStart + 1;
|
int commentLen = commentEnd - commentStart + 1;
|
||||||
if (commentLen > 127) commentLen = 127;
|
if (commentLen > 127) commentLen = 127;
|
||||||
|
|
||||||
MemoryCopy(defines[defineIndex].desc, linePtr + commentStart, commentLen);
|
MemoryCopy(defines[defineIndex].desc, &linePtr[commentStart], commentLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
defineIndex++;
|
defineIndex++;
|
||||||
|
|
@ -1109,10 +1109,7 @@ static void GetDescription(const char *line, char *description)
|
||||||
}
|
}
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
if (descStart != -1)
|
if (descStart != -1) MemoryCopy(description, &line[descStart], c - descStart);
|
||||||
{
|
|
||||||
MemoryCopy(description, &(line[descStart]), c - descStart);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get text length in bytes, check for \0 character
|
// Get text length in bytes, check for \0 character
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user