[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-users] patch file for fixes
From: |
Mark Junker |
Subject: |
[paragui-users] patch file for fixes |
Date: |
23 Jun 2003 09:00:00 +0100 |
User-agent: |
OpenXP/32 v3.8.8 (Win32) beta |
Hi,
the patch file for all fixes is attached.
Fixes:
1. Event system (breaks binary compatibility)
2. Several signed/unsigned comparisons resolved
3. Several operator precendence warnings resolved (s. gradient.cpp)
4. Added new define (__HAS_INT64) to allow usage of __int64 with other
compilers than Visual C++
5. win32.c include <malloc.h> for Borland C to allow the usage of alloca
6. Removed division by zero in pgscrollbar.cpp
Regards,
Mark Junker
Index: src/core/pgmessageobject.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/pgmessageobject.cpp,v
retrieving revision 1.1.6.8
diff -r1.1.6.8 pgmessageobject.cpp
432c432
< rc = ((cbdata->calledobj)->*(cbdata->obj_cbfunc))(id,
(PG_Widget*)this, data, cbdata->data);
---
> rc = (((PG_EventObject*)
> cbdata->calledobj_real)->*(cbdata->obj_cbfunc))(id, (PG_Widget*)this, data,
> cbdata->data);
460a461
> #if 0
463a465
> #endif
625a628,632
> }
>
> bool PG_MessageObject::RegisterEventHandlerObj(PG_MSG_TYPE type,
> PG_MessageObject* obj, void *calledobj_real, PG_EventObject* calledobj,
> MSG_CALLBACK_OBJ obj_cbfunc, void* data)
> {
> return PG_RegisterEventHandlerObj(type, obj, calledobj_real, calledobj,
> obj_cbfunc, data);
Index: src/core/pgmsgmap.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/Attic/pgmsgmap.cpp,v
retrieving revision 1.1.6.2
diff -r1.1.6.2 pgmsgmap.cpp
125a126
> cbdata->calledobj_real = NULL;
153c154
< bool PG_RegisterEventHandlerObj(PG_MSG_TYPE type, PG_MessageObject* obj,
PG_EventObject* called_obj, MSG_CALLBACK_OBJ obj_cbfunc, void* data) {
---
> bool PG_RegisterEventHandlerObj(PG_MSG_TYPE type, PG_MessageObject* obj, void
> *calledobj_real, PG_EventObject* called_obj, MSG_CALLBACK_OBJ obj_cbfunc,
> void* data) {
166c167,168
< cbdata->calledobj = called_obj;
---
> cbdata->calledobj = called_obj;
> cbdata->calledobj_real = calledobj_real;
Index: src/core/pgmsgmap.h
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/Attic/pgmsgmap.h,v
retrieving revision 1.1
diff -r1.1 pgmsgmap.h
47a48,50
> /** real object pointer */
> void *calledobj_real;
>
77c80
< bool PG_RegisterEventHandlerObj(PG_MSG_TYPE type, PG_MessageObject* obj,
PG_EventObject* called_obj, MSG_CALLBACK_OBJ obj_cbfunc, void* data);
---
> bool PG_RegisterEventHandlerObj(PG_MSG_TYPE type, PG_MessageObject* obj, void
> *calledobj_real, PG_EventObject* called_obj, MSG_CALLBACK_OBJ obj_cbfunc,
> void* data);
Index: src/draw/drawline.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/drawline.cpp,v
retrieving revision 1.3
diff -r1.3 drawline.cpp
33c33,34
< void plotpixel(SDL_Surface* surface, Uint32 x, Uint32 y, const SDL_Color& c,
Uint8 width, int *pixelflag) {
---
> void plotpixel(SDL_Surface* surface, Uint32 x, Uint32 y, const SDL_Color& c,
> Uint8 width_arg, int *pixelflag) {
> Uint32 width = (Uint32) width_arg;
Index: src/draw/gradient.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/gradient.cpp,v
retrieving revision 1.3.6.6
diff -r1.3.6.6 gradient.cpp
180,182c180,182
< pixel = (r>>Rloss) << Rshift
< | (g>>Gloss) <<
Gshift
< | (b>>Bloss) <<
Bshift;
---
> pixel = ((r>>Rloss) << Rshift)
> | ((g>>Gloss) <<
> Gshift)
> | ((b>>Bloss) <<
> Bshift);
188,190c188,190
< pixel = (r>>Rloss) << Rshift
< | (g>>Gloss)
<< Gshift
< | (b>>Bloss)
<< Bshift;
---
> pixel = ((r>>Rloss) << Rshift)
> |
> ((g>>Gloss) << Gshift)
> |
> ((b>>Bloss) << Bshift);
202,204c202,204
< pixel = (r>>Rloss) << Rshift
< | (g>>Gloss) <<
Gshift
< | (b>>Bloss) <<
Bshift;
---
> pixel = ((r>>Rloss) << Rshift)
> | ((g>>Gloss) <<
> Gshift)
> | ((b>>Bloss) <<
> Bshift);
Index: src/font/pgfont.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/font/pgfont.cpp,v
retrieving revision 1.3.6.3
diff -r1.3.6.3 pgfont.cpp
223,226c223,226
< color = (r >> Rloss) << Rshift
< | (g >> Gloss) << Gshift
< | (b >> Bloss) << Bshift
< | ((a >> Aloss) << Ashift & Amask);
---
> color = ((r >> Rloss) << Rshift)
> | ((g >> Gloss) << Gshift)
> | ((b >> Bloss) << Bshift)
> | (((a >> Aloss) << Ashift) & Amask);
Index: src/physfs/physfs.h
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/physfs.h,v
retrieving revision 1.1.1.1.6.6
diff -r1.1.1.1.6.6 physfs.h
213c213
< #elif (defined _MSC_VER)
---
> #elif (defined _MSC_VER) || defined(__HAS_INT64)
Index: src/physfs/platform/win32.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/platform/win32.c,v
retrieving revision 1.1.1.1.6.18
diff -r1.1.1.1.6.18 win32.c
26c26,28
< #if (defined _MSC_VER)
---
> #if defined(__BORLANDC__)
> #include <malloc.h>
> #elif (defined _MSC_VER)
823c825
< &HighOrderPos, FILE_BEGIN);
---
> (PLONG) &HighOrderPos, FILE_BEGIN);
840c842
< LowPos = SetFilePointer(FileHandle, 0, &HighPos, FILE_CURRENT);
---
> LowPos = SetFilePointer(FileHandle, 0, (PLONG) &HighPos, FILE_CURRENT);
Index: src/widgets/pglineedit.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pglineedit.cpp,v
retrieving revision 1.3.6.1
diff -r1.3.6.1 pglineedit.cpp
135c135
< for(Uint16 c=my_offsetX; c<=my_text.size(); c++) {
---
> for(unsigned c=my_offsetX; c<=my_text.size(); c++) {
Index: src/widgets/pgrichedit.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgrichedit.cpp,v
retrieving revision 1.3.6.6
diff -r1.3.6.6 pgrichedit.cpp
297c297
< if (widget->second->my_height > maxHeight)
---
> if (((Uint32) widget->second->my_height) >
> maxHeight)
Index: src/widgets/pgscrollbar.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgscrollbar.cpp,v
retrieving revision 1.3.6.1
diff -r1.3.6.1 pgscrollbar.cpp
359a360
> int iScrollDist = scroll_max - scroll_min;
363c364,368
< position[3].y = (Uint16)(position[0].h +
(((double)position[2].h - (double)position[3].h) / (double)(scroll_max -
scroll_min)) * (double)pos);
---
> if (iScrollDist==0) {
> position[3].y = (Uint16)position[0].h;
> } else {
> position[3].y = (Uint16)(position[0].h +
> (((double)position[2].h - (double)position[3].h) / (double) iScrollDist) *
> (double)pos);
> }
367c372,376
< position[3].x = (Uint16)(position[0].w +
(((double)position[2].w - (double)position[3].w) / (double)(scroll_max -
scroll_min)) * (double)pos);
---
> if (iScrollDist==0) {
> position[3].x = (Uint16)position[0].w;
> } else {
> position[3].x = (Uint16)(position[0].w +
> (((double)position[2].w - (double)position[3].w) / (double) iScrollDist) *
> (double)pos);
> }
Index: src/widgets/pgwidget.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidget.cpp,v
retrieving revision 1.4.4.22
diff -r1.4.4.22 pgwidget.cpp
922c922
< for(Uint16 i=0; i<widgetList.size(); i++) {
---
> for(unsigned i=0; i<widgetList.size(); i++) {
930c930
< for(Uint16 i=0; i<widgetList.size(); i++) {
---
> for(unsigned i=0; i<widgetList.size(); i++) {
Index: include/pgmessageobject.h
===================================================================
RCS file: /cvsroot/paragui/paragui/include/pgmessageobject.h,v
retrieving revision 1.3.6.3
diff -r1.3.6.3 pgmessageobject.h
133,134c133,137
< */
< void SetEventObject(PG_MSG_TYPE type, PG_EventObject* calledobj,
MSG_CALLBACK_OBJ cbfunc, void *clientdata = NULL);
---
> */
> template <class T>
> void SetEventObject(PG_MSG_TYPE type, T* calledobj, MSG_CALLBACK_OBJ
> cbfunc, void *clientdata = NULL) {
> RegisterEventHandlerObj(type, this, (void*) calledobj, calledobj,
> cbfunc, clientdata);
> }
321a325,326
>
> bool RegisterEventHandlerObj(PG_MSG_TYPE type, PG_MessageObject* obj,
> void *calledobj_real, PG_EventObject* called_obj, MSG_CALLBACK_OBJ
> obj_cbfunc, void* data);
- [paragui-users] patch file for fixes,
Mark Junker <=