Changeset 8453 for trunk/webif/pages_gen.c
- Timestamp:
- 03/02/13 15:22:23 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/webif/pages_gen.c
r8446 r8453 343 343 // Calculate positions at which the values would be storred 344 344 uint32_t cur_pos = 0; 345 #define align_up(val, align) (val += (align - val % align)) 345 346 for (i = 0; i < templates.num; i++) { 346 347 struct template *t = &templates.data[i]; … … 348 349 t->data_len = t->buf_len; 349 350 // +1 to leave space for \0 350 t->ident_ofs = cur_pos; cur_pos += strlen(t->ident) + 1; 351 t->data_ofs = cur_pos; cur_pos += t->data_len + 1; 352 t->deps_ofs = cur_pos; cur_pos += strlen(t->deps) + 1; 351 t->ident_ofs = cur_pos; cur_pos += strlen(t->ident) + 1; align_up(cur_pos, sizeof(void *)); 352 t->data_ofs = cur_pos; cur_pos += t->data_len + 1; align_up(cur_pos, sizeof(void *)); 353 t->deps_ofs = cur_pos; cur_pos += strlen(t->deps) + 1; align_up(cur_pos, sizeof(void *)); 353 354 } 354 355
Note:
See TracChangeset
for help on using the changeset viewer.