Subversion Repositories filter_foundry

Rev

Rev 236 | Rev 241 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 236 Rev 238
Line 141... Line 141...
141
        }
141
        }
142
        return key;
142
        return key;
143
#endif
143
#endif
144
}
144
}
145
 
145
 
146
long roundToNext4(long x) {
146
size_t roundToNext4(size_t x) {
147
        int pad = 4 - (x % 4);
147
        int pad = 4 - (x % 4);
148
        if (pad == 0) pad = 4;
148
        if (pad == 0) pad = 4;
149
        return x + pad;
149
        return x + pad;
150
}
150
}
151
 
151
 
Line 175... Line 175...
175
        /* add Title/Name property key */
175
        /* add Title/Name property key */
176
 
176
 
177
        prop->vendorID = kPhotoshopSignature;
177
        prop->vendorID = kPhotoshopSignature;
178
        prop->propertyKey = PINameProperty;
178
        prop->propertyKey = PINameProperty;
179
        prop->propertyID = 0;
179
        prop->propertyID = 0;
180
        prop->propertyLength = roundToNext4(title[0] + 1);
180
        prop->propertyLength = (SPInt32)roundToNext4(title[0] + 1);
181
        memset(prop->propertyData, 0x00, prop->propertyLength); // fill padding with 00h bytes (cosmetics)
181
        memset(prop->propertyData, 0x00, prop->propertyLength); // fill padding with 00h bytes (cosmetics)
182
        PLstrcpy((StringPtr)prop->propertyData, title);
182
        PLstrcpy((StringPtr)prop->propertyData, title);
183
 
183
 
184
        // skip past new property record, and any padding
184
        // skip past new property record, and any padding
185
        p += offsetof(PIProperty, propertyData) + prop->propertyLength;
185
        p += offsetof(PIProperty, propertyData) + prop->propertyLength;
Line 189... Line 189...
189
 
189
 
190
        prop->vendorID = kPhotoshopSignature;
190
        prop->vendorID = kPhotoshopSignature;
191
        prop->propertyKey = PICategoryProperty;
191
        prop->propertyKey = PICategoryProperty;
192
        prop->propertyID = 0;
192
        prop->propertyID = 0;
193
 
193
 
194
        prop->propertyLength = roundToNext4(gdata->parm.category[0] + 1);
194
        prop->propertyLength = (SPInt32)roundToNext4(gdata->parm.category[0] + 1);
195
        memset(prop->propertyData, 0x00, prop->propertyLength); // fill padding with 00h bytes (cosmetics)
195
        memset(prop->propertyData, 0x00, prop->propertyLength); // fill padding with 00h bytes (cosmetics)
196
        PLstrcpy((StringPtr)prop->propertyData, gdata->parm.category);
196
        PLstrcpy((StringPtr)prop->propertyData, gdata->parm.category);
197
 
197
 
198
        p += offsetof(PIProperty, propertyData) + prop->propertyLength;
198
        p += offsetof(PIProperty, propertyData) + prop->propertyLength;
199
        prop = (PIProperty*)p;
199
        prop = (PIProperty*)p;
Line 231... Line 231...
231
        prop->propertyKey = PIHasTerminologyProperty;
231
        prop->propertyKey = PIHasTerminologyProperty;
232
        prop->propertyID = 0;
232
        prop->propertyID = 0;
233
 
233
 
234
        realLength = offsetof(struct hstm_data, scope) + scopelen + 1/*null-term*/;
234
        realLength = offsetof(struct hstm_data, scope) + scopelen + 1/*null-term*/;
235
        roundedLength = roundToNext4(realLength);
235
        roundedLength = roundToNext4(realLength);
236
        prop->propertyLength = roundedLength;
236
        prop->propertyLength = (SPInt32)roundedLength;
237
        memset(prop->propertyData + realLength, 0x00, roundedLength - realLength); // fill padding with 00h bytes (cosmetics)
237
        memset(prop->propertyData + realLength, 0x00, roundedLength - realLength); // fill padding with 00h bytes (cosmetics)
238
 
238
 
239
        hstm->version = 0;
239
        hstm->version = 0;
240
        hstm->class_id = plugInClassID;
240
        hstm->class_id = plugInClassID;
241
        hstm->event_id = *event_id;
241
        hstm->event_id = *event_id;