From: <and...@us...> - 2011-10-20 22:02:28
|
Revision: 11991 http://plplot.svn.sourceforge.net/plplot/?rev=11991&view=rev Author: andrewross Date: 2011-10-20 22:02:21 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Yet more code tidying to fix compiler warnings. Modified Paths: -------------- trunk/drivers/tk.c trunk/examples/c/extXdrawable_demo.c trunk/include/plplot.h trunk/include/plstrm.h trunk/src/pdfutils.c trunk/src/plargs.c trunk/src/plbox.c trunk/src/plbuf.c trunk/src/plcore.c trunk/src/plot3d.c Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/drivers/tk.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -1135,11 +1135,11 @@ static void launch_server( PLStream *pls ) { - TkDev *dev = (TkDev *) pls->dev; - const char *argv[20]; - char *plserver_exec = NULL, *ptr; - char *tmp = NULL; - int i; + TkDev *dev = (TkDev *) pls->dev; + const char *argv[20]; + char *plserver_exec = NULL, *ptr; + char *tmp = NULL; + int i; dbug_enter( "launch_server" ); @@ -1292,7 +1292,7 @@ fprintf( stderr, "Starting up %s on node %s\n", pls->plserver, pls->server_host ); - if ( execvp( "rsh", (char *const *)argv ) ) + if ( execvp( "rsh", (char * const *) argv ) ) { perror( "Unable to exec server process" ); _exit( 1 ); Modified: trunk/examples/c/extXdrawable_demo.c =================================================================== --- trunk/examples/c/extXdrawable_demo.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/examples/c/extXdrawable_demo.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -34,8 +34,8 @@ // Main menu structure static GtkItemFactoryEntry menu_items[] = { - { "/_File", NULL, NULL, 0, "<Branch>" }, - { "/File/_Quit", "<control>Q", gtk_main_quit, 0, NULL }, + { "/_File", NULL, NULL, 0, "<Branch>", NULL }, + { "/File/_Quit", "<control>Q", gtk_main_quit, 0, NULL, NULL }, }; #define APP_INITIAL_WIDTH 320 @@ -155,7 +155,7 @@ // Construct the main menu structure item_factory = gtk_item_factory_new( GTK_TYPE_MENU_BAR, "<main>", accel_group ); - gtk_item_factory_create_items( item_factory, nitems, menu_items, NULL ); + gtk_item_factory_create_items( item_factory, (guint) nitems, menu_items, NULL ); gtk_window_add_accel_group( GTK_WINDOW( a->rootwindow ), accel_group ); menubar = gtk_item_factory_get_widget( item_factory, "<main>" ); gtk_box_pack_start( GTK_BOX( vbox ), menubar, FALSE, FALSE, 0 ); Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/include/plplot.h 2011-10-20 22:02:21 UTC (rev 11991) @@ -386,8 +386,8 @@ typedef struct { - PLFLT *f; - PLINT nx, ny, nz; + const PLFLT *f; + PLINT nx, ny, nz; } PLfGrid; // Modified: trunk/include/plstrm.h =================================================================== --- trunk/include/plstrm.h 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/include/plstrm.h 2011-10-20 22:02:21 UTC (rev 11991) @@ -530,10 +530,10 @@ { // Misc control information - PLINT ipls, level, verbose, debug, initialized, dev_initialized; + PLINT ipls, level, verbose, debug, initialized, dev_initialized; //CONSTANT SOVERSION FIX // PLBOOL stream_closed; - const char *program; + char *program; // Plot-wide coordinate transform Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/pdfutils.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -604,14 +604,17 @@ int pdf_rd_2bytes( PDFstrm *pdfs, U_SHORT *ps ) { - U_CHAR x[2]; + U_CHAR x[2]; + U_SHORT xs; if ( !pdf_rdx( x, 2, pdfs ) ) return PDF_RDERR; *ps = 0; - *ps |= (U_SHORT) x[0]; - *ps |= (U_SHORT) x[1] << 8; + xs = (U_SHORT) x[0]; + *ps |= xs; + xs = (U_SHORT) ( (U_SHORT) x[1] << 8 ); + *ps |= xs; return 0; } @@ -648,8 +651,9 @@ int pdf_rd_2nbytes( PDFstrm *pdfs, U_SHORT *s, PLINT n ) { - PLINT i; - U_CHAR x[2]; + PLINT i; + U_CHAR x[2]; + U_SHORT xs; for ( i = 0; i < n; i++ ) { @@ -657,8 +661,10 @@ return PDF_RDERR; s[i] = 0; - s[i] |= (U_SHORT) x[0]; - s[i] |= (U_SHORT) x[1] << 8; + xs = (U_SHORT) x[0]; + s[i] |= xs; + xs = (U_SHORT) ( (U_SHORT) x[1] << 8 ); + s[i] |= xs; } return 0; } Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plargs.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -856,8 +856,8 @@ if ( !mode_noprogram ) { - program = plstrdup( argv[0] ); - plsc->program = program; + plsc->program = plstrdup( argv[0] ); + program = (const char *) plsc->program; --myargc; ++argv; } if ( myargc == 0 ) Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plbox.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -1377,9 +1377,9 @@ PLFLT vpwxmin, vpwxmax, vpwymin, vpwymax; PLFLT pos, tn, tp, offset, height, just; PLFLT factor, tstart; - const char *timefmt; + const char *timefmt = NULL; PLFLT default_mm, char_height_mm, height_mm; - PLFLT string_length_mm, pos_mm; + PLFLT string_length_mm = 0.0, pos_mm = 0.0; plgchr( &default_mm, &char_height_mm ); Modified: trunk/src/plbuf.c =================================================================== --- trunk/src/plbuf.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plbuf.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -771,7 +771,7 @@ static void rdbuf_image( PLStream *pls ) { - short *dev_ix, *dev_iy; + short *dev_ix, *dev_iy = NULL; unsigned short *dev_z, dev_zmin, dev_zmax; PLINT nptsX, nptsY, npts; PLFLT xmin, ymin, dx, dy; Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plcore.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -1227,7 +1227,7 @@ { *tmp = (unsigned char) 0xc0 | (unsigned char) ( unichar >> 6 ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( unichar & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( unichar & (PLUINT) 0x3f ) ); tmp++; len = 2; } @@ -1235,9 +1235,9 @@ { *tmp = (unsigned char) 0xe0 | (unsigned char) ( unichar >> 12 ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ) ); tmp++; - *tmp = (unsigned char) 0x80 | ( (unsigned char) unichar & 0x3f ); + *tmp = (unsigned char) ( 0x80 | ( (unsigned char) unichar & 0x3f ) ); tmp++; len = 3; } @@ -1245,11 +1245,11 @@ { *tmp = (unsigned char) 0xf0 | (unsigned char) ( unichar >> 18 ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 12 ) & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( ( unichar >> 12 ) & 0x3f ) ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ) ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( unichar & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( unichar & 0x3f ) ); tmp++; len = 4; } @@ -2862,8 +2862,8 @@ static int plDispatchSequencer( const void *p1, const void *p2 ) { - const PLDispatchTable* t1 = *(PLDispatchTable **) p1; - const PLDispatchTable* t2 = *(PLDispatchTable **) p2; + const PLDispatchTable* t1 = *(const PLDispatchTable * const *) p1; + const PLDispatchTable* t2 = *(const PLDispatchTable * const *) p2; // printf( "sorting: t1.name=%s t1.seq=%d t2.name=%s t2.seq=%d\n", // t1->pl_DevName, t1->pl_seq, t2->pl_DevName, t2->pl_seq ); Modified: trunk/src/plot3d.c =================================================================== --- trunk/src/plot3d.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plot3d.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -979,7 +979,7 @@ PLFLT ( *getz )( PLPointer, PLINT, PLINT ) = zops->get; PLFLT *_x = NULL, *_y = NULL, **_z = NULL; const PLFLT *x_modified, *y_modified; - int i; + int i; pl3mode = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |