comparison src/libpst.c @ 97:57bc6251f8dd stable-0-6-19

fix an installed unpackaged file code cleanup from compiler warnings
author Carl Byington <carl@five-ten-sg.com>
date Sun, 14 Sep 2008 15:55:11 -0700
parents 997cf1373f9e
children 1e4a7610d525
comparison
equal deleted inserted replaced
96:2e3ec9511166 97:57bc6251f8dd
289 289
290 size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE* fp) { 290 size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE* fp) {
291 pst_index_ll *ptr; 291 pst_index_ll *ptr;
292 pst_holder h = {NULL, fp, 0}; 292 pst_holder h = {NULL, fp, 0};
293 size_t size = 0; 293 size_t size = 0;
294 int32_t x;
295 DEBUG_ENT("pst_attach_to_file"); 294 DEBUG_ENT("pst_attach_to_file");
296 if (attach->id_val != (uint64_t)-1) { 295 if (attach->id_val != (uint64_t)-1) {
297 ptr = pst_getID(pf, attach->id_val); 296 ptr = pst_getID(pf, attach->id_val);
298 if (ptr) { 297 if (ptr) {
299 // pst_num_array *list = pst_parse_block(pf, ptr->id, NULL, NULL); 298 // pst_num_array *list = pst_parse_block(pf, ptr->id, NULL, NULL);
300 // DEBUG_WARN(("writing file data attachment\n")); 299 // DEBUG_WARN(("writing file data attachment\n"));
301 // for (x=0; x<list->count_item; x++) { 300 // for (int32_t x=0; x<list->count_item; x++) {
302 // DEBUG_HEXDUMPC(list->items[x]->data, list->items[x]->size, 0x10); 301 // DEBUG_HEXDUMPC(list->items[x]->data, list->items[x]->size, 0x10);
303 // (void)pst_fwrite(list->items[x]->data, (size_t)1, list->items[x]->size, fp); 302 // (void)pst_fwrite(list->items[x]->data, (size_t)1, list->items[x]->size, fp);
304 // } 303 // }
305 size = pst_ff_getID2data(pf, ptr, &h); 304 size = pst_ff_getID2data(pf, ptr, &h);
306 } else { 305 } else {
319 318
320 size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE* fp) { 319 size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE* fp) {
321 pst_index_ll *ptr; 320 pst_index_ll *ptr;
322 pst_holder h = {NULL, fp, 1}; 321 pst_holder h = {NULL, fp, 1};
323 size_t size = 0; 322 size_t size = 0;
324 int32_t x;
325 char *c; 323 char *c;
326 DEBUG_ENT("pst_attach_to_file_base64"); 324 DEBUG_ENT("pst_attach_to_file_base64");
327 if (attach->id_val != (uint64_t)-1) { 325 if (attach->id_val != (uint64_t)-1) {
328 ptr = pst_getID(pf, attach->id_val); 326 ptr = pst_getID(pf, attach->id_val);
329 if (ptr) { 327 if (ptr) {
330 // pst_num_array *list = pst_parse_block(pf, ptr->id, NULL, NULL); 328 // pst_num_array *list = pst_parse_block(pf, ptr->id, NULL, NULL);
331 // DEBUG_WARN(("writing base64 data attachment\n")); 329 // DEBUG_WARN(("writing base64 data attachment\n"));
332 // for (x=0; x<list->count_item; x++) { 330 // for (int32_t x=0; x<list->count_item; x++) {
333 // DEBUG_HEXDUMPC(list->items[x]->data, list->items[x]->size, 0x10); 331 // DEBUG_HEXDUMPC(list->items[x]->data, list->items[x]->size, 0x10);
334 // c = base64_encode(list->items[x]->data, list->items[x]->size); 332 // c = base64_encode(list->items[x]->data, list->items[x]->size);
335 // if (c) { 333 // if (c) {
336 // (void)pst_fwrite(c, (size_t)1, strlen(c), fp); 334 // (void)pst_fwrite(c, (size_t)1, strlen(c), fp);
337 // free(c); // caught by valgrind 335 // free(c); // caught by valgrind
4449 return ret; 4447 return ret;
4450 } 4448 }
4451 4449
4452 4450
4453 size_t pst_ff_compile_ID(pst_file *pf, uint64_t id, pst_holder *h, size_t size) { 4451 size_t pst_ff_compile_ID(pst_file *pf, uint64_t id, pst_holder *h, size_t size) {
4454 size_t z, a, b; 4452 size_t z, a;
4455 uint16_t count, y; 4453 uint16_t count, y;
4456 char *buf3 = NULL, *buf2 = NULL, *t; 4454 char *buf3 = NULL, *buf2 = NULL, *t;
4457 char *b_ptr; 4455 char *b_ptr;
4458 int line_count = 0; 4456 int line_count = 0;
4459 char base64_extra_chars[3]; 4457 char base64_extra_chars[3];