From: Curt M. <we...@us...> - 2005-10-21 20:28:09
|
Update of /cvsroot/xastir/xastir/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18092 Modified Files: objects.c Log Message: Another tweak by Paul Morris for proper handling of CAD objects. Index: objects.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/objects.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** objects.c 21 Oct 2005 18:02:27 -0000 1.15 --- objects.c 21 Oct 2005 20:28:01 -0000 1.16 *************** *** 2351,2355 **** fprintf(f,"label_longitude: %lu\n",object_ptr->label_longitude); fprintf(f,"label: %s\n",object_ptr->label); ! fprintf(f,"comment: %s\n",object_ptr->comment); // Iterate through the vertices: --- 2351,2359 ---- fprintf(f,"label_longitude: %lu\n",object_ptr->label_longitude); fprintf(f,"label: %s\n",object_ptr->label); ! if (strlen(object_ptr->comment)>1) { ! fprintf(f,"comment: %s\n",object_ptr->comment); ! } else { ! fprintf(f,"comment: NULL\n"); ! } // Iterate through the vertices: *************** *** 2421,2425 **** if (1 != sscanf(line+15, "%lu", (unsigned long *)&CAD_list_head->creation_time)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2425,2429 ---- if (1 != sscanf(line+15, "%lu", (unsigned long *)&CAD_list_head->creation_time)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [creation_time]\n"); } } *************** *** 2428,2432 **** if (1 != sscanf(line+12,"%d", &CAD_list_head->line_color)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2432,2436 ---- if (1 != sscanf(line+12,"%d", &CAD_list_head->line_color)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [line_color]\n"); } } *************** *** 2435,2439 **** if (1 != sscanf(line+11,"%d", &CAD_list_head->line_type)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2439,2443 ---- if (1 != sscanf(line+11,"%d", &CAD_list_head->line_type)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [line_type]\n"); } } *************** *** 2442,2446 **** if (1 != sscanf(line+12,"%d", &CAD_list_head->line_width)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2446,2450 ---- if (1 != sscanf(line+12,"%d", &CAD_list_head->line_width)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [line_width]\n"); } } *************** *** 2449,2453 **** if (1 != sscanf(line+15,"%f", &CAD_list_head->computed_area)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2453,2457 ---- if (1 != sscanf(line+15,"%f", &CAD_list_head->computed_area)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [computed_area]\n"); } } *************** *** 2456,2460 **** if (1 != sscanf(line+17,"%f", &CAD_list_head->raw_probability)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2460,2464 ---- if (1 != sscanf(line+17,"%f", &CAD_list_head->raw_probability)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [raw_probability]\n"); } } *************** *** 2463,2467 **** if (1 != sscanf(line+16,"%lu", (unsigned long *)&CAD_list_head->label_latitude)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2467,2471 ---- if (1 != sscanf(line+16,"%lu", (unsigned long *)&CAD_list_head->label_latitude)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [label_latitude]\n"); } } *************** *** 2470,2474 **** if (1 != sscanf(line+17,"%lu", (unsigned long *)&CAD_list_head->label_longitude)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2474,2478 ---- if (1 != sscanf(line+17,"%lu", (unsigned long *)&CAD_list_head->label_longitude)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [label_longitude]\n"); } } *************** *** 2477,2481 **** if (1 != sscanf(line+7,"%s", CAD_list_head->label)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } --- 2481,2485 ---- if (1 != sscanf(line+7,"%s", CAD_list_head->label)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [label]\n"); } } *************** *** 2484,2489 **** if (1 != sscanf(line+9,"%s", CAD_list_head->comment)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } } else if (strncasecmp(line,"Vertice:",8) == 0) { --- 2488,2499 ---- if (1 != sscanf(line+9,"%s", CAD_list_head->comment)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [comment]\n"); } + if (strcmp(CAD_list_head->comment,"NULL")==0) + xastir_snprintf(CAD_list_head->comment, + sizeof(CAD_list_head->comment), + "%c", + '\0' + ); } else if (strncasecmp(line,"Vertice:",8) == 0) { *************** *** 2494,2498 **** (unsigned long *)&latitude, (unsigned long *)&longitude)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error\n"); } CAD_vertice_allocate(latitude,longitude); --- 2504,2508 ---- (unsigned long *)&latitude, (unsigned long *)&longitude)) { ! fprintf(stderr,"Restore_CAD_Objects_from_file:sscanf parsing error [vertex]\n"); } CAD_vertice_allocate(latitude,longitude); |