summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2020-05-23 10:09:08 +0200
committerMarti Maria <marti.maria@littlecms.com>2020-05-23 10:09:08 +0200
commitd702e32c9d6dc07302aea3be2c0ad3b47d519d5e (patch)
tree979ff06543fddc71e58f73c08e6a40716181a885
parentbb953f5817bd73b282244f1ecf5445c52c433f61 (diff)
downloadlcms2-d702e32c9d6dc07302aea3be2c0ad3b47d519d5e.tar.gz
Update cmscgats.c
- Get rid of a bunch of code from uncertain origin (it was doing nonsense anyway) - Format the function layout
-rw-r--r--src/cmscgats.c64
1 files changed, 23 insertions, 41 deletions
diff --git a/src/cmscgats.c b/src/cmscgats.c
index 4d8a44e..e472439 100644
--- a/src/cmscgats.c
+++ b/src/cmscgats.c
@@ -2165,66 +2165,48 @@ void CookPointers(cmsIT8* it8)
if (cmsstrcasecmp(Fld, "SAMPLE_ID") == 0) {
- t -> SampleID = idField;
-
- for (i=0; i < t -> nPatches; i++) {
-
- char *Data = GetData(it8, i, idField);
- if (Data) {
- char Buffer[256];
-
- strncpy(Buffer, Data, 255);
- Buffer[255] = 0;
-
- if (strlen(Buffer) <= strlen(Data))
- strcpy(Data, Buffer);
- else
- SetData(it8, i, idField, Buffer);
-
- }
- }
-
+ t -> SampleID = idField;
}
// "LABEL" is an extension. It keeps references to forward tables
- if ((cmsstrcasecmp(Fld, "LABEL") == 0) || Fld[0] == '$' ) {
+ if ((cmsstrcasecmp(Fld, "LABEL") == 0) || Fld[0] == '$') {
- // Search for table references...
- for (i=0; i < t -> nPatches; i++) {
+ // Search for table references...
+ for (i = 0; i < t->nPatches; i++) {
- char *Label = GetData(it8, i, idField);
+ char* Label = GetData(it8, i, idField);
- if (Label) {
+ if (Label) {
- cmsUInt32Number k;
+ cmsUInt32Number k;
- // This is the label, search for a table containing
- // this property
+ // This is the label, search for a table containing
+ // this property
- for (k=0; k < it8 ->TablesCount; k++) {
+ for (k = 0; k < it8->TablesCount; k++) {
- TABLE* Table = it8 ->Tab + k;
- KEYVALUE* p;
+ TABLE* Table = it8->Tab + k;
+ KEYVALUE* p;
- if (IsAvailableOnList(Table->HeaderList, Label, NULL, &p)) {
+ if (IsAvailableOnList(Table->HeaderList, Label, NULL, &p)) {
- // Available, keep type and table
- char Buffer[256];
+ // Available, keep type and table
+ char Buffer[256];
- char *Type = p ->Value;
- int nTable = (int) k;
+ char* Type = p->Value;
+ int nTable = (int)k;
- snprintf(Buffer, 255, "%s %d %s", Label, nTable, Type );
+ snprintf(Buffer, 255, "%s %d %s", Label, nTable, Type);
- SetData(it8, i, idField, Buffer);
- }
- }
+ SetData(it8, i, idField, Buffer);
+ }
+ }
- }
+ }
- }
+ }
}