From 48a35c626362118bda3ed557ec3b9acbbac78374 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 13 Jun 2012 10:36:05 +0000 Subject: [PATCH] 2012-06-13 12:34 UTC+0200 Viktor Szakats (vszakats syenar.net) * contrib/hbqt/qtcore/hbqt_bind.cpp ! using core constant instead of arbirary buffer size % use HB_SIZEOFARRAY() instead of calculated explicit versions of above arbitrary sized buffers * contrib/hbqt/qtcore/hbqt_misc.prg * minor formatting --- harbour/ChangeLog | 9 +++++++++ harbour/contrib/hbqt/qtcore/hbqt_bind.cpp | 6 +++--- harbour/contrib/hbqt/qtcore/hbqt_misc.prg | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 54728dfdc3..3afaf09397 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-13 12:34 UTC+0200 Viktor Szakats (vszakats syenar.net) + * contrib/hbqt/qtcore/hbqt_bind.cpp + ! using core constant instead of arbirary buffer size + % use HB_SIZEOFARRAY() instead of calculated explicit + versions of above arbitrary sized buffers + + * contrib/hbqt/qtcore/hbqt_misc.prg + * minor formatting + 2012-06-13 11:41 UTC+0200 Viktor Szakats (vszakats syenar.net) * contrib/hbqt/qtcore/hbqt_bind.cpp * contrib/hbqt/qtcore/hbqt_hbqevents.cpp diff --git a/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp b/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp index 950bc5ee39..25fef8061a 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp @@ -79,7 +79,7 @@ typedef struct _HBQT_BIND PHBQT_DEL_FUNC pDelFunc; int iFlags; bool fDeleting; - char szClassName[ 100 ]; + char szClassName[ HB_SYMBOL_NAME_LEN + 1 ]; struct _HBQT_BIND * next; } HBQT_BIND, * PHBQT_BIND; @@ -171,7 +171,7 @@ PHB_ITEM hbqt_bindGetHbObject( PHB_ITEM pItem, void * qtObject, const char * szC bind->pDelFunc = pDelFunc; bind->iFlags = iFlags; bind->fDeleting = false; - hb_strncpy( bind->szClassName, szClassName, 99 ); + hb_strncpy( bind->szClassName, szClassName, HB_SIZEOFARRAY( bind->szClassName ) - 1 ); bind->next = s_hbqt_binds; s_hbqt_binds = bind; } @@ -243,7 +243,7 @@ PHB_ITEM hbqt_bindSetHbObject( PHB_ITEM pItem, void * qtObject, const char * szC bind->pDelFunc = pDelFunc; bind->iFlags = iFlags; bind->fDeleting = false; - hb_strncpy( bind->szClassName, szClassName, 99 ); + hb_strncpy( bind->szClassName, szClassName, HB_SIZEOFARRAY( bind->szClassName ) - 1 ); bind->next = s_hbqt_binds; s_hbqt_binds = bind; diff --git a/harbour/contrib/hbqt/qtcore/hbqt_misc.prg b/harbour/contrib/hbqt/qtcore/hbqt_misc.prg index 54efe08897..2c65d54bfa 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_misc.prg +++ b/harbour/contrib/hbqt/qtcore/hbqt_misc.prg @@ -85,7 +85,7 @@ CREATE CLASS HbQtObjectHandler METHOD HbQtObjectHandler:setSlots() IF empty( ::__Slots ) - ::__Slots := {=>} + ::__Slots := { => } hb_hDefault( ::__Slots, {} ) ENDIF