2011-04-20 02:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbunix/hbunix.hbp
* contrib/hbcurl/hbcurl.hbm
* contrib/hbnetio/hbnetio.hbp
* contrib/hbnetio/hbnetio.hbx
* contrib/gtwvg/gtwvg.hbp
* contrib/hbwin/hbwin.hbp
* contrib/hbsqlit3/hbsqlit3.hbp
* contrib/hbexpat/hbexpat.hbp
+ Enabled -std=c89 option when building with any gcc compiler.
(TOFIX: now GTWVG breaks with error)
I mean this as an experiment which I'd like to extend
gradually to whole Harbour as it seems a good way to
ensure the code being truly ANSI C as we claim it. It
can certainly avoid a few unnecessary rounds with
committed code problems.
Now that there are multiple ANSI C standards we may
want to discuss which level we want to stick with
(C89/C90, C99, C1X) until then let's assume C89 even though
not all of Harbour code complies ATM. F.e.:
../../../hbprintf.c:543:4: warning: implicit declaration of function 'modfl'
../../../hbprintf.c:1146:25: warning: implicit declaration of function 'isfinite'
* contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.cpp
* contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp
* contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp
* contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp
* contrib/hbqt/qtcore/hbqt_pointer.cpp
* contrib/hbqt/qtcore/hbqt_hbqslots.cpp
! Converted C++ style comments to ANSI C.
Even though it's C++ code it's good to stick with one
comment style (ANSI C) accross Harbour to avoid getting wrong customs.
Pls stick to it.
This commit is contained in:
@@ -16,6 +16,42 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2011-04-20 02:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbunix/hbunix.hbp
|
||||
* contrib/hbcurl/hbcurl.hbm
|
||||
* contrib/hbnetio/hbnetio.hbp
|
||||
* contrib/hbnetio/hbnetio.hbx
|
||||
* contrib/gtwvg/gtwvg.hbp
|
||||
* contrib/hbwin/hbwin.hbp
|
||||
* contrib/hbsqlit3/hbsqlit3.hbp
|
||||
* contrib/hbexpat/hbexpat.hbp
|
||||
+ Enabled -std=c89 option when building with any gcc compiler.
|
||||
(TOFIX: now GTWVG breaks with error)
|
||||
|
||||
I mean this as an experiment which I'd like to extend
|
||||
gradually to whole Harbour as it seems a good way to
|
||||
ensure the code being truly ANSI C as we claim it. It
|
||||
can certainly avoid a few unnecessary rounds with
|
||||
committed code problems.
|
||||
|
||||
Now that there are multiple ANSI C standards we may
|
||||
want to discuss which level we want to stick with
|
||||
(C89/C90, C99, C1X) until then let's assume C89 even though
|
||||
not all of Harbour code complies ATM. F.e.:
|
||||
../../../hbprintf.c:543:4: warning: implicit declaration of function 'modfl'
|
||||
../../../hbprintf.c:1146:25: warning: implicit declaration of function 'isfinite'
|
||||
|
||||
* contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.cpp
|
||||
* contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp
|
||||
* contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp
|
||||
* contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp
|
||||
* contrib/hbqt/qtcore/hbqt_pointer.cpp
|
||||
* contrib/hbqt/qtcore/hbqt_hbqslots.cpp
|
||||
! Converted C++ style comments to ANSI C.
|
||||
Even though it's C++ code it's good to stick with one
|
||||
comment style (ANSI C) accross Harbour to avoid getting wrong customs.
|
||||
Pls stick to it.
|
||||
|
||||
2011-04-19 16:43 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbxbp/xbpparthandler.prg
|
||||
! Changed: ::_aOwned => ::a_Owned to not generate error when
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
# Optimize build time and make sure we build even with this option
|
||||
-cflag=-DWIN32_LEAN_AND_MEAN
|
||||
|
||||
-cflag=-std=c89{allgcc}
|
||||
|
||||
-instfile=inc:hbgtwvg.ch
|
||||
-instfile=inc:wvtwin.ch
|
||||
-instfile=inc:wvgparts.ch
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
-w3 -es2
|
||||
|
||||
-cflag=-std=c89{allgcc}
|
||||
|
||||
-depkeyhead=curl:curl/curl.h
|
||||
-depcontrol=curl:no{HB_BUILD_3RDEXT='no'}
|
||||
-depcontrol=curl:${HB_WITH_CURL}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
-w3 -es2
|
||||
|
||||
-cflag=-std=c89{allgcc}
|
||||
|
||||
-depkeyhead=expat:expat.h
|
||||
-depcontrol=expat:local{HB_BUILD_3RDEXT='no'}
|
||||
-depcontrol=expat:${HB_WITH_EXPAT}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
-w3 -es2
|
||||
|
||||
-cflag=-std=c89{allgcc}
|
||||
|
||||
-instfile=inc:hbmemio.hbx
|
||||
|
||||
hbmemio.hbx
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
-w3 -es2
|
||||
|
||||
-cflag=-std=c89{allgcc}
|
||||
|
||||
-instfile=inc:hbnetio.hbx
|
||||
|
||||
hbnetio.hbx
|
||||
|
||||
@@ -48,6 +48,7 @@ DYNAMIC NETIO_SERVERSTOP
|
||||
DYNAMIC NETIO_SRVSENDDATA
|
||||
DYNAMIC NETIO_SRVSENDITEM
|
||||
DYNAMIC NETIO_SRVSTATUS
|
||||
DYNAMIC NETIO_VERIFYCLIENT
|
||||
|
||||
#if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__HBNETIO__REQUEST )
|
||||
#uncommand DYNAMIC <fncs,...> => EXTERNAL <fncs>
|
||||
|
||||
@@ -330,7 +330,6 @@ HB_FUNC( __HBQT_SLOTS_DISCONNECT )
|
||||
|
||||
if( t_slots->listBlock.at( i - 1 ) != NULL )
|
||||
{
|
||||
//HB_TRACE( HB_TR_DEBUG, ( " __HBQT_SLOTS_DISCONNECT %d", i ) );
|
||||
hb_itemRelease( t_slots->listBlock.at( i - 1 ) );
|
||||
t_slots->listBlock[ i - 1 ] = NULL;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,6 @@ void * hbqt_par_obj( int iParam )
|
||||
}
|
||||
else
|
||||
{
|
||||
//hb_errRT_BASE( EG_ARG, 8000, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
HBQT_GC_T * p;
|
||||
p = ( HBQT_GC_T * ) hb_parptrGC( hbqt_gcFuncs(), iParam );
|
||||
if( p && p->ph )
|
||||
@@ -169,7 +168,6 @@ void * hbqt_gcpointer( int iParam )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hbqt_gcpointer(): returns RAW pointer: %p", hb_parptr( iParam ) ) );
|
||||
return NULL;
|
||||
//return hb_parptr( iParam ); /* TOFIX: In what cases is this needed? Reference counting to avoid referring to freed pointers? */
|
||||
}
|
||||
else if( HB_ISOBJECT( iParam ) )
|
||||
{
|
||||
@@ -240,8 +238,8 @@ void hbqt_set_pptr( void * ptr, PHB_ITEM pSelf )
|
||||
static PHB_DYNS s_pDyns_hPPtrAssign = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hbqt_set_pptr( ptr =%p, pSelf=%p )", ptr, pSelf ) );
|
||||
// get the position of _PPTR member, the
|
||||
// leading underscore because I want to write to it
|
||||
/* get the position of _PPTR member, the
|
||||
leading underscore because I want to write to it */
|
||||
|
||||
if( ! s_pDyns_hPPtrAssign )
|
||||
s_pDyns_hPPtrAssign = hb_dynsymGetCase( "_PPTR" );
|
||||
@@ -252,25 +250,25 @@ void hbqt_set_pptr( void * ptr, PHB_ITEM pSelf )
|
||||
return; /* TODO: Still better if RTE. */
|
||||
}
|
||||
|
||||
// push the _PPTR address
|
||||
/* push the _PPTR address */
|
||||
hb_vmPushDynSym( s_pDyns_hPPtrAssign );
|
||||
|
||||
// push the instance we want change _PPTR value
|
||||
// it was already on the stack, but we push a pointer to it
|
||||
/* push the instance we want change _PPTR value
|
||||
it was already on the stack, but we push a pointer to it */
|
||||
hb_vmPush( pSelf );
|
||||
|
||||
// push the actual value
|
||||
/* push the actual value */
|
||||
hb_vmPushPointerGC( ptr );
|
||||
|
||||
// run the command with 1 parameter
|
||||
/* run the command with 1 parameter */
|
||||
hb_vmSend( 1 );
|
||||
}
|
||||
|
||||
void hbqt_itemPushReturn( void* ptr, PHB_ITEM pSelf )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "itemPushReturn( ptr =%p, pSelf=%p )", ptr, pSelf ) );
|
||||
// get the position of _PPTR member, the
|
||||
// leading underscore because I want to write to it
|
||||
/* get the position of _PPTR member, the
|
||||
leading underscore because I want to write to it */
|
||||
|
||||
if( pSelf == NULL )
|
||||
pSelf = hb_stackSelfItem();
|
||||
@@ -526,7 +524,7 @@ PHB_ITEM hbqt_defineClassBegin( const char * szClsName, PHB_ITEM s_oClass, const
|
||||
hb_vmPushNil();
|
||||
hb_vmDo( 0 );
|
||||
|
||||
// TODO: change this hack
|
||||
/* TODO: change this hack */
|
||||
char test[ HB_SYMBOL_NAME_LEN + 1 ];
|
||||
hb_snprintf( test, sizeof( test ), "HB_%s", szClsName );
|
||||
|
||||
@@ -618,4 +616,4 @@ PHB_ITEM hbqt_create_objectGC( void * pObject, const char * pszObjectName )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#endif // #if QT_VERSION >= 0x040500
|
||||
#endif
|
||||
|
||||
@@ -79,8 +79,8 @@ HBQGraphicsItem::HBQGraphicsItem( int type, QGraphicsItem * parent ) : QGraphics
|
||||
|
||||
iResizeMode = RESIZE_MODE_FIXED;
|
||||
iResizeFlags = RESIZE_MODE_LEFT | RESIZE_MODE_TOP | RESIZE_MODE_RIGHT | RESIZE_MODE_BOTTOM;
|
||||
dWidth = 20 / UNIT; // 20 mm
|
||||
dHeight = 20 / UNIT; // 20 mm
|
||||
dWidth = 20 / UNIT; /* 20 mm */
|
||||
dHeight = 20 / UNIT; /* 20 mm */
|
||||
iOpacity = 100;
|
||||
iResizeHandle = 2 / UNIT;
|
||||
iBGMode = Qt::TransparentMode;
|
||||
@@ -483,7 +483,7 @@ void HBQGraphicsItem::setLegendColorRectWidth( int legendColorRectWidth )
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Mouse Events
|
||||
/* Mouse Events */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
void HBQGraphicsItem::contextMenuEvent( QGraphicsSceneContextMenuEvent * event )
|
||||
@@ -533,7 +533,7 @@ void HBQGraphicsItem::mousePressEvent( QGraphicsSceneMouseEvent * event )
|
||||
QGraphicsItem::mousePressEvent( event );
|
||||
|
||||
if( event->buttons() == Qt::LeftButton ){
|
||||
// emit( itemSelected( this, event->pos() ) );
|
||||
/* emit( itemSelected( this, event->pos() ) ); */
|
||||
if( block ){
|
||||
PHB_ITEM p1 = hb_itemPutNI( NULL, 21101 );
|
||||
PHB_ITEM p2 = hb_itemPutC( NULL, objectName().toLatin1().data() );
|
||||
@@ -551,9 +551,9 @@ void HBQGraphicsItem::mouseReleaseEvent( QGraphicsSceneMouseEvent * event )
|
||||
|
||||
QRectF nGeometry = geometry();
|
||||
if( nGeometry != QRectF_geometry ){
|
||||
// emit( geometryChanged( this, nGeometry, QRectF_geometry ) );
|
||||
/* emit( geometryChanged( this, nGeometry, QRectF_geometry ) ); */
|
||||
if( block ){
|
||||
// Inform geometry is changed
|
||||
/* Inform geometry is changed */
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -632,7 +632,7 @@ int HBQGraphicsItem::determineResizeMode( const QPointF & pos )
|
||||
return mode;
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Drag Events
|
||||
/* Drag Events */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
void HBQGraphicsItem::dragEnterEvent( QGraphicsSceneDragDropEvent * event )
|
||||
@@ -703,13 +703,13 @@ void HBQGraphicsItem::dropEvent( QGraphicsSceneDragDropEvent * event )
|
||||
QTreeWidgetItem * item = tree->topLevelItem( row );
|
||||
|
||||
hb_arrayNew( p3, 3 );
|
||||
//
|
||||
|
||||
hb_arraySetC( p3, 1, tree->objectName().toLatin1().data() );
|
||||
hb_arraySetC( p3, 2, roleDataMap.value( Qt::DisplayRole ).toString().toLatin1().data() );
|
||||
hb_arraySetC( p3, 3, item->text( 0 ).toLatin1().data() );
|
||||
//
|
||||
|
||||
hb_vmEvalBlockV( block, 3, p1, p2, p3 );
|
||||
//
|
||||
|
||||
hb_itemRelease( p1 );
|
||||
hb_itemRelease( p2 );
|
||||
hb_itemRelease( p3 );
|
||||
@@ -726,8 +726,9 @@ void HBQGraphicsItem::dropEvent( QGraphicsSceneDragDropEvent * event )
|
||||
}
|
||||
QGraphicsItem::dropEvent( event );
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Painting
|
||||
/* Painting */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
QRectF HBQGraphicsItem::boundingRect() const
|
||||
@@ -762,7 +763,7 @@ void HBQGraphicsItem::prepare( QPainter * painter )
|
||||
QRectF rc = fm.boundingRect( rect, textFlags(), QString_text );
|
||||
if( rc.height() > rect.height() )
|
||||
{
|
||||
//setStretch( rc.height() - rect.height() );
|
||||
/* setStretch( rc.height() - rect.height() ); */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ void HBQGraphicsScene::setMagnetArea( int magnetArea )
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Mouse Events
|
||||
/* Mouse Events */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
void HBQGraphicsScene::mouseMoveEvent( QGraphicsSceneMouseEvent * mouseEvent )
|
||||
@@ -289,8 +289,9 @@ void HBQGraphicsScene::mouseReleaseEvent( QGraphicsSceneMouseEvent * event )
|
||||
}
|
||||
QGraphicsScene::mouseReleaseEvent( event );
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Key Events
|
||||
/* Key Events */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
void HBQGraphicsScene::keyReleaseEvent( QKeyEvent * keyEvent )
|
||||
@@ -402,8 +403,9 @@ void HBQGraphicsScene::keyPressEvent( QKeyEvent * keyEvent )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Drag & Drop
|
||||
/* Drag & Drop */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
void HBQGraphicsScene::contextMenuEvent( QGraphicsSceneContextMenuEvent * event )
|
||||
@@ -487,13 +489,12 @@ void HBQGraphicsScene::dropEvent( QGraphicsSceneDragDropEvent * event )
|
||||
if( curItem )
|
||||
{
|
||||
hb_arrayNew( p3, 3 );
|
||||
//
|
||||
|
||||
hb_arraySetC( p3, 1, tree->objectName().toLatin1().data() );
|
||||
hb_arraySetC( p3, 2, parent->text( 0 ).toLatin1().data() );
|
||||
hb_arraySetC( p3, 3, curItem->text( 0 ).toLatin1().data() );
|
||||
//
|
||||
|
||||
hb_vmEvalBlockV( block, 3, p1, p2, p3 );
|
||||
//
|
||||
}
|
||||
}
|
||||
hb_itemRelease( p1 );
|
||||
@@ -511,8 +512,9 @@ void HBQGraphicsScene::dropEvent( QGraphicsSceneDragDropEvent * event )
|
||||
}
|
||||
QGraphicsScene::dropEvent( event );
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
// General
|
||||
/* General */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
bool HBQGraphicsScene::showGrid()
|
||||
@@ -572,7 +574,7 @@ void HBQGraphicsScene::drawBorder()
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
// Magnets
|
||||
/* Magnets */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
void HBQGraphicsScene::setLeftMagnet( bool magneted )
|
||||
|
||||
@@ -1375,7 +1375,7 @@ void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event )
|
||||
case Qt::Key_Tab :
|
||||
case Qt::Key_Backtab :
|
||||
event->ignore();
|
||||
return; // let the completer do default behavior
|
||||
return; /* let the completer do default behavior */
|
||||
case Qt::Key_Space:
|
||||
if( block ){
|
||||
PHB_ITEM p1 = hb_itemPutNI( NULL, 21001 );
|
||||
@@ -1432,7 +1432,7 @@ void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event )
|
||||
static QString eow( " ~!@#$%^&*()+{}|:\"<>?,./;'[]\\-=" ); /* end of word */
|
||||
bool hasModifier = ( event->modifiers() != Qt::NoModifier ) && !ctrlOrShift;
|
||||
QString completionPrefix = hbTextUnderCursor( true );
|
||||
//QString completionPrefix = hbTextUnderCursor( false );
|
||||
/*QString completionPrefix = hbTextUnderCursor( false );*/
|
||||
|
||||
if( hasModifier ||
|
||||
event->text().isEmpty() ||
|
||||
@@ -1454,7 +1454,7 @@ void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event )
|
||||
cr.setTop( cr.top() + horzRulerHeight + 5 );
|
||||
cr.setBottom( cr.bottom() + horzRulerHeight + 5 );
|
||||
|
||||
c->complete( cr ); // pop it up!
|
||||
c->complete( cr ); /* pop it up! */
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -1589,7 +1589,7 @@ void HBQPlainTextEdit::paintEvent( QPaintEvent * event )
|
||||
this->hbPaintHighlight( event );
|
||||
this->hbPaintSelection( event );
|
||||
|
||||
// this->hbDrawCursor( event );
|
||||
/* this->hbDrawCursor( event ); */
|
||||
|
||||
QPlainTextEdit::paintEvent( event );
|
||||
}
|
||||
|
||||
@@ -164,7 +164,6 @@ void HBQSyntaxHighlighter::highlightBlock( const QString &text )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//HB_TRACE( HB_TR_DEBUG, ( "SYNTSX HIGHLIGHTING" ) );
|
||||
|
||||
int index = 0;
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
-w3 -es2
|
||||
|
||||
-cflag=-std=c89{allgcc}
|
||||
|
||||
-depkeyhead=sqlite3:sqlite3.h
|
||||
-depcontrol=sqlite3:local{HB_BUILD_3RDEXT='no'}
|
||||
-depcontrol=sqlite3:${HB_WITH_SQLITE3}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
-w3 -es2
|
||||
|
||||
-cflag=-std=c89{allgcc}
|
||||
|
||||
-stop{!unix}
|
||||
|
||||
hbunix.hbx
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
-cflag=-DWIN32_LEAN_AND_MEAN
|
||||
|
||||
-cflag=-std=c89{allgcc}
|
||||
|
||||
-depkeyhead=png:png.h
|
||||
-depcontrol=png:local{HB_BUILD_3RDEXT='no'}
|
||||
-depcontrol=png:${HB_WITH_PNG}
|
||||
|
||||
Reference in New Issue
Block a user