From: Karl S. <ksc...@rs...> - 2001-03-22 17:43:56
|
> -----Original Message----- > From: Sven M. Hallberg [mailto:pe...@gm...] > Sent: Wednesday, March 21, 2001 9:37 AM > To: Dirk Reiners > Cc: Brian Paul; RC; mes...@li... > Subject: [Mesa3d-dev] Re: [Mesa3d-users] configure problem > (was Missing > GLX extensions) snip > > > Well, if the compiler doesn't support the feature the > only way would be > > to use > > > some sort of preprocessor kludge or hard-code the > function names. Both > > options > > > seem kind of hard to accept. I'd say we check for the > feature and in > > case it's > > > not available #define __FUNCTION__ to something sensable > expressing the > > lack. > > > > It does support __FILE__ and __LINE__, maybe using these > would be better > > than not having any indications of the problem happened. > __FUNCTION__ is a problem for Windows as well. It would be nice to have #if defined(VMS) || defined(WIN32) #define __FUNCTION__ #endif in texutil_tmp.h Another problem is warning C4003: not enough actual parameters for macro 'ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL' which is caused by #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \ do { \ if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { \ _mesa_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \ return retval; \ } \ } while (0) #define ASSERT_OUTSIDE_BEGIN_END(ctx) \ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx,) in mtypes.h. I think that the code is expanding to what we want, but is just generating a warning. If we're sure that this is OK, then # pragma warning( disable : 4003 ) /* not enough actual parameters for macro */ may be a good addition to glheader.h (under the MESA_MINWARN group) Karl |
From: Gareth H. <ga...@va...> - 2001-03-22 17:49:37
|
Karl Schultz wrote: > > __FUNCTION__ is a problem for Windows as well. > > It would be nice to have > > #if defined(VMS) || defined(WIN32) > #define __FUNCTION__ > #endif > > in texutil_tmp.h Sorry, that's my fault. I'm too used to gcc... > Another problem is > > warning C4003: not enough actual parameters for macro > 'ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL' > > which is caused by > > #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \ > do { \ > if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { \ > _mesa_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \ > return retval; \ > } \ > } while (0) > > #define ASSERT_OUTSIDE_BEGIN_END(ctx) \ > ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx,) > > in mtypes.h. > > I think that the code is expanding to what we want, but is just generating a > warning. If we're sure that this is OK, then > > # pragma warning( disable : 4003 ) /* not enough actual parameters for > macro */ > > may be a good addition to glheader.h (under the MESA_MINWARN group) I have new and improved win32 makefiles (in fact, a general cleanup of the old makefiles for DOS, win32 and so on) sitting on my Win2000 partition. I've fixed this as part of that, so next time I boot into that I can commit this. No timeframe for that, of course... -- Gareth |
From: Brian P. <br...@va...> - 2001-03-22 17:51:22
|
Karl Schultz wrote: > > > -----Original Message----- > > From: Sven M. Hallberg [mailto:pe...@gm...] > > Sent: Wednesday, March 21, 2001 9:37 AM > > To: Dirk Reiners > > Cc: Brian Paul; RC; mes...@li... > > Subject: [Mesa3d-dev] Re: [Mesa3d-users] configure problem > > (was Missing > > GLX extensions) > > snip > > > > > Well, if the compiler doesn't support the feature the > > only way would be > > > to use > > > > some sort of preprocessor kludge or hard-code the > > function names. Both > > > options > > > > seem kind of hard to accept. I'd say we check for the > > feature and in > > > case it's > > > > not available #define __FUNCTION__ to something sensable > > expressing the > > > lack. > > > > > > It does support __FILE__ and __LINE__, maybe using these > > would be better > > > than not having any indications of the problem happened. > > > > __FUNCTION__ is a problem for Windows as well. > > It would be nice to have > > #if defined(VMS) || defined(WIN32) > #define __FUNCTION__ > #endif > > in texutil_tmp.h Better yet: #ifndef __FUNCTION__ #define __FUNCTION__ "<some function>" #endif > Another problem is > > warning C4003: not enough actual parameters for macro > 'ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL' > > which is caused by > > #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \ > do { \ > if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { \ > _mesa_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \ > return retval; \ > } \ > } while (0) > > #define ASSERT_OUTSIDE_BEGIN_END(ctx) \ > ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx,) > > in mtypes.h. > > I think that the code is expanding to what we want, but is just generating a > warning. If we're sure that this is OK, then > > # pragma warning( disable : 4003 ) /* not enough actual parameters for > macro */ > > may be a good addition to glheader.h (under the MESA_MINWARN group) The pragma might hide other, legitimate problems. I'd rather just see the macro changed: #define ASSERT_OUTSIDE_BEGIN_END(ctx) do { \ if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { \ _mesa_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \ return; \ } \ } while (0) -Brian |
From: Keith W. <ke...@va...> - 2001-03-22 17:59:27
|
Brian Paul wrote: > > Karl Schultz wrote: > > > > > -----Original Message----- > > > From: Sven M. Hallberg [mailto:pe...@gm...] > > > Sent: Wednesday, March 21, 2001 9:37 AM > > > To: Dirk Reiners > > > Cc: Brian Paul; RC; mes...@li... > > > Subject: [Mesa3d-dev] Re: [Mesa3d-users] configure problem > > > (was Missing > > > GLX extensions) > > > > snip > > > > > > > Well, if the compiler doesn't support the feature the > > > only way would be > > > > to use > > > > > some sort of preprocessor kludge or hard-code the > > > function names. Both > > > > options > > > > > seem kind of hard to accept. I'd say we check for the > > > feature and in > > > > case it's > > > > > not available #define __FUNCTION__ to something sensable > > > expressing the > > > > lack. > > > > > > > > It does support __FILE__ and __LINE__, maybe using these > > > would be better > > > > than not having any indications of the problem happened. > > > > > > > __FUNCTION__ is a problem for Windows as well. > > > > It would be nice to have > > > > #if defined(VMS) || defined(WIN32) > > #define __FUNCTION__ > > #endif > > > > in texutil_tmp.h > > Better yet: > > #ifndef __FUNCTION__ > #define __FUNCTION__ "<some function>" > #endif I don't thing __FUNCTION__ is defined outside of functions, even in gcc. As much as I like and value __FUNCTION__ for working with templates, I'm tempted to say we shouldn't allow it into CVS. Keith |
From: Sven M. H. <pe...@gm...> - 2001-03-22 20:25:42
|
On Thu, Mar 22, 2001 at 12:00:29PM -0700, Keith Whitwell wrote: > As much as I like and value __FUNCTION__ for working with templates, I'm > tempted to say we shouldn't allow it into CVS. I wouldn't be that absolute. As long as we perform a clean check, thus assuming it being defined, one way or the other, I'd say we use it. -- @SVEN_M_HALLBERG@ <$(pesco_gmx.de)> "Would the All-Seeing Eye please look in my direction?" [ KeyID........: 0xC297FEAB ] [ Fingerprint..: FEA5 0F93 7320 3F39 66A5 AED3 073F 2D5F C297 FEAB ] |
From: Antti T. <se...@si...> - 2001-03-22 19:05:42
|
On Thu, 22 Mar 2001, Brian Paul wrote: > > __FUNCTION__ is a problem for Windows as well. > > > > It would be nice to have > > > > #if defined(VMS) || defined(WIN32) > > #define __FUNCTION__ > > #endif > > > > in texutil_tmp.h > > Better yet: > > #ifndef __FUNCTION__ > #define __FUNCTION__ "<some function>" > #endif That would define __FUNCTION__ as "<some function>" with gcc also, the only way to get through that is #ifndef __GNUC__ #define __FUNCTION__ "<some function>" #endif Works for me. ___ Antti Tapaninen se...@si... |
From: Sven M. H. <pe...@gm...> - 2001-03-22 20:24:28
|
On Thu, Mar 22, 2001 at 11:04:44AM -0700, Brian Paul wrote: > Karl Schultz wrote: > > __FUNCTION__ is a problem for Windows as well. > > > > It would be nice to have > > > > #if defined(VMS) || defined(WIN32) > > #define __FUNCTION__ > > #endif > > > > in texutil_tmp.h > > Better yet: > > #ifndef __FUNCTION__ > #define __FUNCTION__ "<some function>" > #endif As Antti mentioned, __FUNCTION__ is a gcc-builtin _variable_, not a preprocessor macro. Furthermore, shouldn't we rather check whether the compiler supports it at configure time? I guess there's a GCC for VMS, or not? Anyways, even a VMS or Win32 compiler might support __FUNCTION__, so it wouldn't be wise to just check for VMS/WIN32 being #define'd, but rather #define some other macro, in Make-config or by the configure script respectively and check that one. What do you think? -- @SVEN_M_HALLBERG@ <$(pesco_gmx.de)> "Would the All-Seeing Eye please look in my direction?" [ KeyID........: 0xC297FEAB ] [ Fingerprint..: FEA5 0F93 7320 3F39 66A5 AED3 073F 2D5F C297 FEAB ] |
From: <her...@ru...> - 2001-03-22 18:19:40
|
Hello! I'm really sorry if this question bothers you in any way, but it seems this is the only place I can ask it and actually receive a reasonable answer. Is there any way I can calculate the area of a triangle defined by his vertices (x1,y1) - (x2,y2) - (x3,y3) WITHOUT the use of SQRT() in any part of the formula? Thanks in advance for your answer! - Heriberto Delgado (her...@ru...) |
From: Stephen J B. <sj...@li...> - 2001-03-22 18:48:57
|
Oe Thu, 22 Mar 2001 her...@ru... wrote: > > Hello! I'm really sorry if this question bothers you in any way, but it > seems this > is the only place I can ask it and actually receive a reasonable answer. You'd stand a VERY good chance of getting an answer if you posted it to the 'gdalgorithms' list. They *thrive* on questions like this. gda...@li... Subscribe at Sourceforge. > Is there any way I can calculate the area of a triangle defined by his > vertices (x1,y1) - (x2,y2) - (x3,y3) WITHOUT the use of SQRT() in any > part of the formula? Yes. (That was easy!) ...oh - you want to know *HOW* as well...OK. Here are the steps needed to calculate the area of a 2D polygon. It doesn't matter if the polygon is listed in a clockwise or counter-clockwise order, it can be convex or concave, or even self-intersect. /* x & y are arrays containing the x and y coordinates of the polygon vertices. npoints is the number of points in each list. */ double area ( int npoints, double *x, double *y ) { double area = 0.0 ; for ( int i = 0 ; i < npoints ; i++ ) { int ii = (i+1) % npoints ; area += x[i] * y[ii] - x[ii] * y[i] ; } return fabs ( area / 2.0 ) ; } ---- Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |
From: <her...@ru...> - 2001-03-22 20:53:27
|
Thank everyone for the quick answers... they helped a lot! - Heriberto Delgado (her...@ru...) -----Original Message----- From: mes...@li... [mailto:mes...@li...]On Behalf Of Stephen J Baker Sent: Jueves, 22 de Marzo de 2001 12:49 p.m. To: io...@cr... Cc: mes...@li... Subject: Re: [Mesa3d-dev] Seriously off-topic question... Oe Thu, 22 Mar 2001 her...@ru... wrote: > > Hello! I'm really sorry if this question bothers you in any way, but it > seems this > is the only place I can ask it and actually receive a reasonable answer. You'd stand a VERY good chance of getting an answer if you posted it to the 'gdalgorithms' list. They *thrive* on questions like this. gda...@li... Subscribe at Sourceforge. > Is there any way I can calculate the area of a triangle defined by his > vertices (x1,y1) - (x2,y2) - (x3,y3) WITHOUT the use of SQRT() in any > part of the formula? Yes. (That was easy!) ...oh - you want to know *HOW* as well...OK. Here are the steps needed to calculate the area of a 2D polygon. It doesn't matter if the polygon is listed in a clockwise or counter-clockwise order, it can be convex or concave, or even self-intersect. /* x & y are arrays containing the x and y coordinates of the polygon vertices. npoints is the number of points in each list. */ double area ( int npoints, double *x, double *y ) { double area = 0.0 ; for ( int i = 0 ; i < npoints ; i++ ) { int ii = (i+1) % npoints ; area += x[i] * y[ii] - x[ii] * y[i] ; } return fabs ( area / 2.0 ) ; } ---- Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 _______________________________________________ Mesa3d-dev mailing list Mes...@li... http://lists.sourceforge.net/lists/listinfo/mesa3d-dev |