Bug 79642 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: MagicPoint
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Akira TAGOH
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-14 10:47 UTC by d.binderman
Modified: 2007-04-18 16:49 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-04-18 12:24:01 UTC
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2002-12-14 10:47:38 UTC
Description of problem:

Hello there,

I just tried to compile package MagicPoint-1.09a-6 from Redhat 8.0.

Here are some of the compiler messages.

tfont.c:166: warning: `regid' might be used uninitialized in this function
tfont.c:557: warning: `regid' might be used uninitialized in this function
gif.c:106: warning: too few arguments for format
gif.c:25: warning: `gifp' might be used uninitialized in this function
pbm.c:363: warning: operation on `destptr' may be undefined
multiVis.c:522: warning: `ximage_ipm' might be used uninitialized in this function

Here is a patch which shuts up the compiler.

*** ./contrib/xwintoppm/multiVis.c.old	2002-11-28 08:27:57.000000000 +0000
--- ./contrib/xwintoppm/multiVis.c	2002-11-28 08:28:30.000000000 +0000
***************
*** 519,525 ****
      image_region_type	*reg;
      XRectangle		bbox;		/* bounding box of grabbed area */
      int 		depth ;
!     XImage		*ximage, *ximage_ipm ;
      Visual		fakeVis ;
      int 	x1, y1;
      XImage	*image;
--- 519,525 ----
      image_region_type	*reg;
      XRectangle		bbox;		/* bounding box of grabbed area */
      int 		depth ;
!     XImage		*ximage, *ximage_ipm = NULL;
      Visual		fakeVis ;
      int 	x1, y1;
      XImage	*image;
*** ./image/gif.c.old	2002-11-28 08:20:48.000000000 +0000
--- ./image/gif.c	2002-11-28 08:26:27.000000000 +0000
***************
*** 103,109 ****
  			if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
  			   GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
  				fprintf(stderr,
! "Image %d is not confined to screen dimension, aborted.\n");
  				exit(-2);
  			}
  			if (GifFile->Image.Interlace) {
--- 103,109 ----
  			if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
  			   GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
  				fprintf(stderr,
! "Image is not confined to screen dimension, aborted.\n");
  				exit(-2);
  			}
  			if (GifFile->Image.Interlace) {
***************
*** 201,207 ****
  		ret = 0;
  	else {
  		DGifCloseFile(gifp);
! 		tellAboutImage(name);
  		ret = 1;
  	}
  	return ret;
--- 201,207 ----
  		ret = 0;
  	else {
  		DGifCloseFile(gifp);
! 		tellAboutImage( name, gifp);
  		ret = 1;
  	}
  	return ret;
*** ./image/pbm.c.old	2002-11-28 08:26:45.000000000 +0000
--- ./image/pbm.c	2002-11-28 08:27:36.000000000 +0000
***************
*** 359,366 ****
         */
  
        destptr = image->data;
!       for (y = 0; y < size; y++)
! 	*(destptr++) = PM_SCALE(*destptr, maxval, 0xff);
        break;
  
      case ITRUE:
--- 359,368 ----
         */
  
        destptr = image->data;
!       for (y = 0; y < size; y++) {
! 	*destptr = PM_SCALE(*destptr, maxval, 0xff);
!         destptr++;
!       }
        break;
  
      case ITRUE:
*** ./tfont.c.old	2002-11-28 08:20:05.000000000 +0000
--- ./tfont.c	2002-11-28 08:20:28.000000000 +0000
***************
*** 163,169 ****
  	int charset16;
  {
  	struct tfont *tfc, *ntfc;
! 	int	regid;
  
  	if (!tfcinitdone)
  		tfc_init();
--- 163,169 ----
  	int charset16;
  {
  	struct tfont *tfc, *ntfc;
! 	int	regid = 0;
  
  	if (!tfcinitdone)
  		tfc_init();
***************
*** 554,560 ****
  	TT_CharMap      char_map;
  	unsigned short  i, n;
  	unsigned short  platform, encoding;
! 	unsigned int	regid;
  	char			p;
  
  	/* First, look for a Unicode charmap */
--- 554,560 ----
  	TT_CharMap      char_map;
  	unsigned short  i, n;
  	unsigned short  platform, encoding;
! 	unsigned int	regid = 0;
  	char			p;
  
  	/* First, look for a Unicode charmap */


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:

Comment 1 Akira TAGOH 2003-04-18 09:52:52 UTC
on 9, some warnings no longer appears. but some warnings newly appears.

Comment 2 Akira TAGOH 2003-04-18 12:24:01 UTC
should be fixed in 1.09a-10


Note You need to log in before you can comment on or make changes to this bug.