PRC9108008: C 5.1 _pie() with Narrow Wedge May Fill Screen

ID Number: Q75323

5.10

MS-DOS

buglist5.10 fixlist6.00

Summary:

PROBLEM ID: PRC9108008

SYMPTOMS

In the Microsoft C Compiler version 5.1 and the Microsoft QuickC

Compiler versions 1.0, 1.01, 2.0, and 2.01, when attempting to fill

a pie wedge that approximates a line, the entire screen may be

filled.

CAUSE

The function takes nine parameters:

_pie( SHORT control, SHORT x1, SHORT y1, SHORT x2, SHORT y2,

SHORT x3, SHORT y3, SHORT x4, SHORT y4 )

The first parameter to _pie() determines whether the wedge is

filled or not. The next two parameters define the upper-left corner

of a rectangle and the two after that define the lower-right corner

of a rectangle. The rectangle bounds an ellipse. The wedge displayed

is the portion of the ellipse bounded by two vectors. These vectors

are defined in the last two pairs of arguments to _pie(). When these

vectors are nearly identical, the wedge approximates a line, and

filling this wedge fills the whole screen.

STATUS

Microsoft has confirmed this to be a problem in C version 5.1 and in

QuickC versions 1.0, 1.01, 2.0, and 2.01 (buglist1.00, buglist1.01,

buglist2.00, buglist2.01). The problem was corrected in C version

6.0 and in QuickC version 2.5 (fixlist2.50).

More Information:

The following program demonstrates the problem.

Sample Code

-----------

// Compile options needed: none

#include <stdio.h>

#include <graph.h>

void main(void);

void main()

{

_setvideomode( _VRES16COLOR );

// The vectors specified are identical, therefore the wedge is a

// line. The _GFILLINTERIOR parameter will floodfill the wedge.

// In C5.10, the entire screen is filled.

_setcolor( 1 );

_pie( _GFILLINTERIOR, 80, 50, 240, 150, 240, 12, 240, 12 );

while( !kbhit() );

_setvideomode( _DEFAULTMODE );

}

Additional reference words: 1.00 2.00 2.50 5.10 6.00