diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 228f32e93a..ae5ba937f3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2010-11-23 17:52 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/wapi_winbase.c + + WAPI_GETCURRENTTHREADID(): Added. + + * contrib/sddmy/sddmy.c + * contrib/sddodbc/sddodbc.c + ! Indenting. + + * contrib/hbgd/gdwrp.c + * contrib/hbgd/gd.prg + * contrib/hbgd/gdchart.prg + * contrib/hbgd/gdimage.prg + - Deleted commented obsolete trace calls. + ! Indenting. + 2010-11-23 12:13 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbmzip/hbmzip.c * cleaned unnecessary variable initialization diff --git a/harbour/contrib/hbgd/gd.prg b/harbour/contrib/hbgd/gd.prg index 30ec520acf..8f508fec6a 100644 --- a/harbour/contrib/hbgd/gd.prg +++ b/harbour/contrib/hbgd/gd.prg @@ -53,216 +53,200 @@ #include "common.ch" FUNCTION gdImageChar( im, font, x, y, char, color ) -RETURN gdImageString( im, font, x, y, char, color ) + RETURN gdImageString( im, font, x, y, char, color ) FUNCTION gdImageCharUp( im, font, x, y, char, color ) -RETURN gdImageStringUp( im, font, x, y, char, color ) + RETURN gdImageStringUp( im, font, x, y, char, color ) FUNCTION gdImageCircle( im, cx, cy, w, color ) -RETURN gdImageArc( im, cx, cy, w, w, 0, 360, color ) + RETURN gdImageArc( im, cx, cy, w, w, 0, 360, color ) FUNCTION gdImageFilledCircle( im, cx, cy, w, color ) -RETURN gdImageFilledEllipse( im, cx, cy, w, w, color ) + RETURN gdImageFilledEllipse( im, cx, cy, w, w, color ) FUNCTION gdImageEllipse( im, cx, cy, w, h, color ) -RETURN gdImageArc( im, cx, cy, w, h, 0, 360, color ) + RETURN gdImageArc( im, cx, cy, w, h, 0, 360, color ) FUNCTION gdImageFTWidth( fontname, ptsize, angle ) - LOCAL nWidth := 0 - LOCAL cErr - LOCAL aRect := Array(8) - DEFAULT fontname TO "Arial" - DEFAULT ptsize TO 8 - DEFAULT angle TO 0 - cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, "M" ) - //__OutDebug( "ptsize", ptsize, aRect ) - IF cErr == "" - nWidth := aRect[3] - aRect[1] - ENDIF + LOCAL nWidth := 0 + LOCAL cErr + LOCAL aRect := Array( 8 ) -RETURN nWidth + DEFAULT fontname TO "Arial" + DEFAULT ptsize TO 8 + DEFAULT angle TO 0 + + cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, "M" ) + + IF cErr == "" + nWidth := aRect[3] - aRect[1] + ENDIF + + RETURN nWidth FUNCTION gdImageFTHeight( fontname, ptsize, angle ) - LOCAL nWidth := 0 - LOCAL cErr - LOCAL aRect := Array(8) - DEFAULT fontname TO "Arial" - DEFAULT ptsize TO 8 - DEFAULT angle TO 0 + LOCAL nWidth := 0 + LOCAL cErr + LOCAL aRect := Array(8) + DEFAULT fontname TO "Arial" + DEFAULT ptsize TO 8 + DEFAULT angle TO 0 - cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, "M" ) - IF cErr == "" - nWidth := aRect[2] - aRect[8] - ENDIF + cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, "M" ) + IF cErr == "" + nWidth := aRect[2] - aRect[8] + ENDIF -RETURN nWidth + RETURN nWidth FUNCTION gdImageFTSize( string, fontname, ptsize, angle ) - LOCAL nWidth := 0 - LOCAL nHeight := 0 - LOCAL nX, nY - LOCAL cErr - LOCAL aRect := Array(8) - DEFAULT fontname TO "Arial" - DEFAULT ptsize TO 8 - DEFAULT angle TO 0 - cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, string ) - //__OutDebug( "ptsize", ptsize, aRect ) - IF cErr == "" - nWidth := aRect[3] - aRect[1] - nHeight := aRect[2] - aRect[8] - nX := aRect[1] - nY := aRect[2] - ENDIF + LOCAL nWidth := 0 + LOCAL nHeight := 0 + LOCAL nX, nY + LOCAL cErr + LOCAL aRect := Array( 8 ) -RETURN { nWidth, nHeight, nX, nY } + DEFAULT fontname TO "Arial" + DEFAULT ptsize TO 8 + DEFAULT angle TO 0 + + cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, string ) + + IF cErr == "" + nWidth := aRect[3] - aRect[1] + nHeight := aRect[2] - aRect[8] + nX := aRect[1] + nY := aRect[2] + ENDIF + + RETURN { nWidth, nHeight, nX, nY } FUNCTION gdImageStringFT( im, fg, fontname, ptsize, angle, x, y, string, ; linespacing, charmap, resolution ) - LOCAL cErr - LOCAL aRect := Array(8) - cErr := gdImageStringFTEx( , @aRect, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution ) - IF cErr == "" - cErr := gdImageStringFTEx( im, aRect, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution ) - ENDIF -RETURN cErr + LOCAL cErr + LOCAL aRect := Array(8) + cErr := gdImageStringFTEx( , @aRect, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution ) + IF cErr == "" + cErr := gdImageStringFTEx( im, aRect, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution ) + ENDIF + RETURN cErr FUNCTION gdImageFromFile( cFile ) - LOCAL cPath, cName, cExt, cDrive - LOCAL cType, cMime - LOCAL hFile := {=>} - LOCAL oImage + LOCAL cPath, cName, cExt, cDrive + LOCAL cType, cMime + LOCAL hFile := {=>} + LOCAL oImage - IF hb_FileExists( cFile ) - HB_FNameSplit( cFile, @cPath, @cName, @cExt, @cDrive ) - //TraceLog( cFile, cPath, cName, cExt, cDrive ) - cExt := Lower( cExt ) - DO CASE - CASE cExt == ".jpg" .OR. cExt == ".jpeg" - hFile[ "file" ] := cFile - hFile[ "path" ] := cPath - hFile[ "name" ] := cName - hFile[ "ext" ] := cExt - hFile[ "drive" ] := cDrive - cType := "jpeg" - cMime := "image/jpeg" - oImage := GDImage():LoadFromJpeg( cFile ) + IF hb_FileExists( cFile ) + HB_FNameSplit( cFile, @cPath, @cName, @cExt, @cDrive ) + SWITCH Lower( cExt ) + CASE ".jpg" + CASE ".jpeg" + hFile[ "file" ] := cFile + hFile[ "path" ] := cPath + hFile[ "name" ] := cName + hFile[ "ext" ] := cExt + hFile[ "drive" ] := cDrive + cType := "jpeg" + cMime := "image/jpeg" + oImage := GDImage():LoadFromJpeg( cFile ) + EXIT - CASE cExt == ".gif" - hFile[ "file" ] := cFile - hFile[ "path" ] := cPath - hFile[ "name" ] := cName - hFile[ "ext" ] := cExt - hFile[ "drive" ] := cDrive - cType := "gif" - cMime := "image/gif" - oImage := GDImage():LoadFromGif( cFile ) + CASE ".gif" + hFile[ "file" ] := cFile + hFile[ "path" ] := cPath + hFile[ "name" ] := cName + hFile[ "ext" ] := cExt + hFile[ "drive" ] := cDrive + cType := "gif" + cMime := "image/gif" + oImage := GDImage():LoadFromGif( cFile ) + EXIT + CASE ".png" + hFile[ "file" ] := cFile + hFile[ "path" ] := cPath + hFile[ "name" ] := cName + hFile[ "ext" ] := cExt + hFile[ "drive" ] := cDrive + cType := "png" + cMime := "image/png" + oImage := GDImage():LoadFromPng( cFile ) + EXIT - CASE cExt == ".png" - hFile[ "file" ] := cFile - hFile[ "path" ] := cPath - hFile[ "name" ] := cName - hFile[ "ext" ] := cExt - hFile[ "drive" ] := cDrive - cType := "png" - cMime := "image/png" - oImage := GDImage():LoadFromPng( cFile ) - ENDCASE + ENDSWITCH - ENDIF + ENDIF -RETURN { oImage, hFile, cType, cMime } + RETURN { oImage, hFile, cType, cMime } FUNCTION gdImageToString( oImage ) - LOCAL cString + LOCAL cString - //Tracelog( "oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' )", ; - // oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' ) ) - - IF ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) - WITH OBJECT oImage - IF :cType != NIL - DO CASE - CASE :cType == "jpeg" - cString := :ToStringJpeg() - CASE :cType == "gif" - cString := :ToStringGif() - CASE :cType == "png" - cString := :ToStringPng() - ENDCASE - ENDIF - END - ENDIF -RETURN cString + IF ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) + WITH OBJECT oImage + IF :cType != NIL + DO CASE + CASE :cType == "jpeg" + cString := :ToStringJpeg() + CASE :cType == "gif" + cString := :ToStringGif() + CASE :cType == "png" + cString := :ToStringPng() + ENDCASE + ENDIF + ENDWITH + ENDIF + RETURN cString PROCEDURE gdImageToFile( oImage, cFile ) - LOCAL cString, cExt + LOCAL cString, cExt - DEFAULT cFile TO "image" + DEFAULT cFile TO "image" - //Tracelog( "oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' )", ; - // oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' ) ) + IF ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) + WITH OBJECT oImage + IF :cType != NIL + DO CASE + CASE :cType == "jpeg" + cString := :ToStringJpeg() + cExt := ".jpg" + CASE :cType == "gif" + cString := :ToStringGif() + cExt := ".gif" + CASE :cType == "png" + cString := :ToStringPng() + cExt := ".png" + OTHERWISE + cExt := "" + ENDCASE + IF cString != NIL + hb_MemoWrit( cFile + cExt, cString ) + ENDIF + ENDIF + ENDWITH + ENDIF - IF ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) - WITH OBJECT oImage - IF :cType != NIL - DO CASE - CASE :cType == "jpeg" - cString := :ToStringJpeg() - cExt := ".jpg" - CASE :cType == "gif" - cString := :ToStringGif() - cExt := ".gif" - CASE :cType == "png" - cString := :ToStringPng() - cExt := ".png" - OTHERWISE - cExt := "" - ENDCASE - IF cString != NIL - hb_MemoWrit( cFile + cExt, cString ) - ENDIF - ENDIF - END - ENDIF - -RETURN + RETURN PROCEDURE gdImageToHandle( oImage, nHandle ) - DEFAULT nHandle TO 1 + DEFAULT nHandle TO 1 - //Tracelog( "oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' )", ; - // oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' ) ) + IF ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) + WITH OBJECT oImage + IF :cType != NIL + DO CASE + CASE :cType == "jpeg" + :OutputJpeg( nHandle ) + CASE :cType == "gif" + :OutputGif( nHandle ) + CASE :cType == "png" + :OutputPng( nHandle ) + ENDCASE + ENDIF + ENDWITH + ENDIF - IF ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) - WITH OBJECT oImage - IF :cType != NIL - DO CASE - CASE :cType == "jpeg" - :OutputJpeg( nHandle ) - CASE :cType == "gif" - :OutputGif( nHandle ) - CASE :cType == "png" - :OutputPng( nHandle ) - ENDCASE - ENDIF - END - ENDIF - -RETURN - -/* - - ////aRect := { 10, 40, 100, 40, 100, 20, 10, 20 } //Array(8) - //aRect := Array(8) - ////TraceLog( "aRect = " + hb_dumpVar( aRect ) ) - //gdImageStringFtEx( , @aRect, blue, "arial", 20, 30, 20, 90, 'Test') - ////TraceLog( "aRect = " + hb_dumpVar( aRect ) ) - //? "aRect = " + hb_dumpVar( aRect ) - //gdImageStringFtEx(im, aRect, blue, "arial", 20, 30, 20, 90, 'Test') - ////TraceLog( "aRect = " + hb_dumpVar( aRect ) ) - -*/ + RETURN diff --git a/harbour/contrib/hbgd/gdchart.prg b/harbour/contrib/hbgd/gdchart.prg index 888650a0c5..53dc115b6d 100644 --- a/harbour/contrib/hbgd/gdchart.prg +++ b/harbour/contrib/hbgd/gdchart.prg @@ -165,9 +165,6 @@ METHOD PieChart() CLASS GDChart ::SetFontGiant() ENDCASE - //__OutDebug( "x, y, nWidth", x, y, nWidth ) - - /* hData := ["TITLE"], ["VALUE"], ["FILLED"], ["COLOR"], ["TILE"], ["EXTRUDE"] */ @@ -183,8 +180,6 @@ METHOD PieChart() CLASS GDChart nWidth -= ( nTotExtr + 2 ) * 2 - //__OutDebug( "nTotExtr, nWidth", nTotExtr, nWidth ) - // Second, FOR EACH hElement IN aPieDataOfHash cLabel := HGetValue( hElement, "LABEL" ) @@ -341,8 +336,6 @@ METHOD VerticalBarChart() CLASS GDChart nTot += hElement["VALUE"] NEXT - //__OutDebug( "Len( LTrim( Str( nMax ) ) )", Len( LTrim( cStr( nMax ) ) ), Str( nMax ) ) - DEFAULT nLeftLabelSpace TO nBorder + Len( LTrim( Transform( nMax, cAxisPict ) ) ) * ::GetFontWidth() + nBorder DEFAULT nRightLabelSpace TO nLeftLabelSpace //nBorder + Len( LTrim( Str( nMax ) ) ) * ::GetFontWidth() + nBorder DEFAULT nBottomLabelSpace TO nBorder + nMaxLabel * ::GetFontWidth() + nBorder @@ -385,7 +378,6 @@ METHOD VerticalBarChart() CLASS GDChart FOR n := 10 TO 100 STEP 10 nDim := ( ( nMaxValue / 100 ) * n ) nPosY := ( nDim / nMaxValue ) * nHeight - //__OutDebug( "nDim", nDim ) ::Line( x, ::Height() - ( y + nPosY), x + nWidth, ::Height() - ( y + nPosY ), gdStyled ) NEXT ::SetThickness( nThick ) @@ -602,7 +594,6 @@ METHOD HorizontalBarChart() CLASS GDChart colorp := HGetValue( hElement, "COLOR" ) nVal := hElement["VALUE"] nDim := ( nVal / nMaxValue ) * nWidth - //__OutDebug( "nDim", nDim ) DEFAULT lFilled TO .F. //DEFAULT nExtrude TO 0 DEFAULT colorp TO ::SetColor( 0, 0, 0 ) @@ -789,7 +780,6 @@ METHOD LineChart() CLASS GDChart FOR n := 10 TO 100 STEP 10 nDim := ( ( nTotRange / 100 ) * n ) nPosY := ( nDim / nTotRange ) * nHeight - //__OutDebug( "nDim", nDim ) ::Line( x, ::Height() - ( y + nPosY), x + nWidth, ::Height() - ( y + nPosY ), gdStyled ) NEXT FOR EACH hElement IN aDataOfHash diff --git a/harbour/contrib/hbgd/gdimage.prg b/harbour/contrib/hbgd/gdimage.prg index 1172b2267d..3c00a16b2f 100644 --- a/harbour/contrib/hbgd/gdimage.prg +++ b/harbour/contrib/hbgd/gdimage.prg @@ -298,7 +298,6 @@ METHOD New( sx, sy ) CLASS GDImage RETURN Self METHOD PROCEDURE Destruct() CLASS GDImage - //__OutDebug( "Destroyed" ) IF ::lDestroy ::Destroy() ENDIF @@ -442,7 +441,6 @@ METHOD CopyRotated( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, nAngle, oDestIm oDestImage := GDImage():Create( nWidth, nHeight ) ENDIF ENDIF - //__OutDebug( nAngle ) gdImageCopyRotated( oDestImage:pImage, ::pImage, nDstX, nDstY, nSrcX, nSrcY, nWidth, nHeight, nAngle ) RETURN oDestImage @@ -526,8 +524,6 @@ METHOD Rotate( nAngle, lInside ) CLASS GDImage nWidth := ::Width nHeight := ::Height ENDIF - //__OutDebug( ::Width, ::Height ) - //__OutDebug( nWidth, nHeight ) IF ::IsTrueColor() oDestImage := GDImage():CreateTrueColor( nWidth, nHeight ) @@ -655,7 +651,6 @@ METHOD SayFreeType( x, y, cString, cFontName, nPitch, nAngle, color, nAlign, ; IF nAlign == gdAlignCenter nWidth := nPitch //gdImageFTWidth( cFontName, nPitch )//, ::Radians( nAngle ) ) //::GetFontWidth() - //__OutDebug( "nWidth", nWidth ) nLen := Len( cString ) nPosX := x - ( (nLen / 2) * nWidth ) ELSEIF nAlign == gdAlignRight diff --git a/harbour/contrib/hbgd/gdwrp.c b/harbour/contrib/hbgd/gdwrp.c index b7eee1eb66..8cb722d82d 100644 --- a/harbour/contrib/hbgd/gdwrp.c +++ b/harbour/contrib/hbgd/gdwrp.c @@ -264,7 +264,6 @@ static void * LoadImageFromHandle( HB_FHANDLE fhandle, int sz ) /* Read file */ iptr = hb_xgrab( sz ); hb_fsReadLarge( fhandle, iptr, ( HB_SIZE ) sz ); - /* TraceLog( NULL, "Error dim %i, read %i", sz, iRead ); */ return iptr; @@ -287,7 +286,6 @@ static void * LoadImageFromFile( const char *szFile, int *sz ) /* Read file */ iptr = hb_xgrab( *sz ); hb_fsReadLarge( fhandle, iptr, ( HB_SIZE ) *sz ); - /* TraceLog( NULL, "Error dim %i, read %i", sz, iRead ); */ /* Close file */ hb_fsClose( fhandle ); @@ -339,8 +337,6 @@ static void GDImageCreateFrom( int nType ) int sz; void * iptr; - /*TraceLog( NULL, "Params = %i, 1 = %i, 2 = %i \n\r", hb_pcount(), hb_parinfo( 1 ), hb_parinfo( 2 ) );*/ - if( hb_pcount() == 1 && ( HB_ISCHAR( 1 ) ) ) @@ -447,7 +443,6 @@ static void GDImageSaveTo( int nType ) } /* Retrieve compression level */ - /*TraceLog( NULL, "Count = %i\n\r", hb_pcount() ); */ /* check if is numeric */ if( !( HB_ISNIL( 3 ) || HB_ISNUM( 3 ) ) ) { @@ -2424,8 +2419,6 @@ HB_FUNC( GDIMAGESTRINGUP ) /* void gdImageCharUp(gdImagePtr im, gdFontPtr font, /* implementation: cError := gdImageStringFTEx( im, aRect, int fg, cFontname, nPtSize, nAngle, x, y, cString, nLinespacing, nCharmap, nResolution ) */ HB_FUNC( GDIMAGESTRINGFTEX ) { - /* TraceLog( NULL, "Parameters: %i, Type 1 =%i=\n\r", hb_pcount(), hb_parinfo( 1 ) ); */ - if( hb_pcount() >= 9 && ( HB_ISNIL( 1 ) || HB_ISPOINTER( 1 ) ) && HB_ISARRAY( 2 ) && @@ -2455,7 +2448,6 @@ HB_FUNC( GDIMAGESTRINGFTEX ) /* Retrieve image pointer */ im = hb_parGdImage( 1 ); - /*TraceLog( NULL, "Image pointer: %p\n\r", im ); */ /* Retrieve rectangle array */ pRect = hb_param( 2, HB_IT_ARRAY ); @@ -2466,28 +2458,22 @@ HB_FUNC( GDIMAGESTRINGFTEX ) /* Retrieve foreground color value */ fg = hb_parni( 3 ); - /*TraceLog( NULL, "Forecolor: %i\n\r", fg ); */ /* Retrieve fontname value */ fontname = hb_parc( 4 ); - /*TraceLog( NULL, "Font: %s\n\r", fontname ); */ /* Retrieve point size value */ ptsize = hb_parni( 5 ); - /*TraceLog( NULL, "PTSize: %lf\n\r", ptsize ); */ /* Retrieve angle value in radians */ angle = hb_parnd( 6 ); - /*TraceLog( NULL, "Angle: %lf\n\r", angle ); */ /* Retrieve pos value */ x = hb_parni( 7 ); y = hb_parni( 8 ); - /*TraceLog( NULL, "Pos: %i, %i\n\r", x, y ); */ /* Retrieve string value */ string = hb_parcx( 9 ); - /*TraceLog( NULL, "String: %s\n\r", string ); */ /* EXTENDED FLAGS */ flags = 0; @@ -2558,8 +2544,6 @@ HB_FUNC( GDIMAGESTRINGFTEX ) HB_FUNC( GDIMAGESTRINGFTCIRCLE ) /* char *gdImageStringFTCircle(gdImagePtr im, int cx, int cy, double radius, double textRadius, double fillPortion, char *font, double points, char *top, char *bottom, int fgcolor) */ { - /*TraceLog( NULL, "Parameters: %i, Type 9 =%i=\n\r", hb_pcount(), hb_parinfo( 10 ) ); */ - if( hb_pcount() == 11 && HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && diff --git a/harbour/contrib/hbwin/wapi_winbase.c b/harbour/contrib/hbwin/wapi_winbase.c index 72250bb5a2..7f4dda94bf 100644 --- a/harbour/contrib/hbwin/wapi_winbase.c +++ b/harbour/contrib/hbwin/wapi_winbase.c @@ -78,6 +78,11 @@ HB_FUNC( WAPI_GETCURRENTTHREAD ) hbwapi_ret_raw_HANDLE( GetCurrentThread() ); } +HB_FUNC( WAPI_GETCURRENTTHREADID ) +{ + hb_retnint( GetCurrentThreadId() ); +} + HB_FUNC( WAPI_WAITFORSINGLEOBJECT ) { DWORD dwResult = WaitForSingleObject( hbwapi_par_raw_HANDLE( 1 ), ( DWORD ) hb_parnl( 2 ) ); diff --git a/harbour/contrib/sddmy/sddmy.c b/harbour/contrib/sddmy/sddmy.c index 0acde743ea..d4a99f49b0 100644 --- a/harbour/contrib/sddmy/sddmy.c +++ b/harbour/contrib/sddmy/sddmy.c @@ -158,13 +158,13 @@ static HB_ERRCODE mysqlConnect( SQLDDCONNECTION * pConnection, PHB_ITEM pItem ) PHB_ITEM pItemUnixSocket = hb_arrayGetItemPtr( pItem, 7 ); pMySql = mysql_init( NULL ); - if ( ! mysql_real_connect( pMySql, - hb_arrayGetCPtr( pItem, 2 ) /* host */, - hb_arrayGetCPtr( pItem, 3 ) /* user */, + if ( ! mysql_real_connect( pMySql, + hb_arrayGetCPtr( pItem, 2 ) /* host */, + hb_arrayGetCPtr( pItem, 3 ) /* user */, hb_arrayGetCPtr( pItem, 4 ) /* password */, - hb_arrayGetCPtr( pItem, 5 ) /* db */, - hb_arrayGetNI( pItem, 6 ) /* port */, - pItemUnixSocket && HB_IS_STRING( pItemUnixSocket ) ? hb_itemGetCPtr( pItemUnixSocket ) : NULL, + hb_arrayGetCPtr( pItem, 5 ) /* db */, + hb_arrayGetNI( pItem, 6 ) /* port */, + pItemUnixSocket && HB_IS_STRING( pItemUnixSocket ) ? hb_itemGetCPtr( pItemUnixSocket ) : NULL, hb_arrayGetNI( pItem, 8 ) /* flags*/ ) ) { hb_rddsqlSetError( mysql_errno( pMySql ), mysql_error( pMySql ), NULL, NULL, 0 ); @@ -283,50 +283,50 @@ static HB_ERRCODE mysqlOpen( SQLBASEAREAP pArea ) { case MYSQL_TYPE_TINY: case MYSQL_TYPE_SHORT: - pFieldInfo.uiType = HB_FT_INTEGER; - break; + pFieldInfo.uiType = HB_FT_INTEGER; + break; case MYSQL_TYPE_LONG: case MYSQL_TYPE_LONGLONG: case MYSQL_TYPE_INT24: - pFieldInfo.uiType = HB_FT_LONG; - break; + pFieldInfo.uiType = HB_FT_LONG; + break; case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_NEWDECIMAL: case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_DOUBLE: - pFieldInfo.uiType = HB_FT_DOUBLE; - pFieldInfo.uiDec = ( HB_USHORT ) pMyField->decimals; - break; + pFieldInfo.uiType = HB_FT_DOUBLE; + pFieldInfo.uiDec = ( HB_USHORT ) pMyField->decimals; + break; case MYSQL_TYPE_STRING: case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_ENUM: - pFieldInfo.uiType = HB_FT_STRING; - break; + pFieldInfo.uiType = HB_FT_STRING; + break; case MYSQL_TYPE_DATE: - pFieldInfo.uiType = HB_FT_DATE; - break; + pFieldInfo.uiType = HB_FT_DATE; + break; case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_BLOB: - pFieldInfo.uiType = HB_FT_MEMO; - break; + pFieldInfo.uiType = HB_FT_MEMO; + break; case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_DATETIME: - pFieldInfo.uiType = HB_FT_TIMESTAMP; - pFieldInfo.uiLen = 8; - break; + pFieldInfo.uiType = HB_FT_TIMESTAMP; + pFieldInfo.uiLen = 8; + break; case MYSQL_TYPE_TIME: - pFieldInfo.uiType = HB_FT_TIME; - pFieldInfo.uiLen = 4; - break; + pFieldInfo.uiType = HB_FT_TIME; + pFieldInfo.uiLen = 4; + break; /* case MYSQL_TYPE_YEAR: @@ -336,10 +336,10 @@ static HB_ERRCODE mysqlOpen( SQLBASEAREAP pArea ) */ default: - bError = HB_TRUE; - errCode = ( HB_ERRCODE ) pMyField->type; - pFieldInfo.uiType = 0; - break; + bError = HB_TRUE; + errCode = ( HB_ERRCODE ) pMyField->type; + pFieldInfo.uiType = 0; + break; } if ( ! bError ) diff --git a/harbour/contrib/sddodbc/sddodbc.c b/harbour/contrib/sddodbc/sddodbc.c index 51be1a3cab..235d2c344d 100644 --- a/harbour/contrib/sddodbc/sddodbc.c +++ b/harbour/contrib/sddodbc/sddodbc.c @@ -429,60 +429,60 @@ static HB_ERRCODE odbcOpen( SQLBASEAREAP pArea ) case SQL_WCHAR: case SQL_WVARCHAR: case SQL_WLONGVARCHAR: - pFieldInfo.uiType = HB_FT_STRING; - break; + pFieldInfo.uiType = HB_FT_STRING; + break; case SQL_VARBINARY: case SQL_LONGVARBINARY: - pFieldInfo.uiType = HB_FT_STRING; - pFieldInfo.uiFlags = HB_FF_BINARY; - break; + pFieldInfo.uiType = HB_FT_STRING; + pFieldInfo.uiFlags = HB_FF_BINARY; + break; case SQL_TINYINT: case SQL_SMALLINT: case SQL_INTEGER: case SQL_BIGINT: - pFieldInfo.uiType = HB_FT_INTEGER; - break; + pFieldInfo.uiType = HB_FT_INTEGER; + break; case SQL_DECIMAL: case SQL_NUMERIC: - pFieldInfo.uiType = HB_FT_LONG; - break; + pFieldInfo.uiType = HB_FT_LONG; + break; case SQL_REAL: case SQL_FLOAT: case SQL_DOUBLE: - pFieldInfo.uiType = HB_FT_DOUBLE; - break; + pFieldInfo.uiType = HB_FT_DOUBLE; + break; case SQL_BIT: - pFieldInfo.uiType = HB_FT_LOGICAL; - break; + pFieldInfo.uiType = HB_FT_LOGICAL; + break; case SQL_DATE: case SQL_TYPE_DATE: - pFieldInfo.uiType = HB_FT_DATE; - break; + pFieldInfo.uiType = HB_FT_DATE; + break; case SQL_TIME: case SQL_TYPE_TIME: - pFieldInfo.uiType = HB_FT_DATE; - break; + pFieldInfo.uiType = HB_FT_DATE; + break; /* SQL_DATETIME = SQL_DATE = 9 */ case SQL_TIMESTAMP: case SQL_TYPE_TIMESTAMP: - pFieldInfo.uiType = HB_FT_TIMESTAMP; - break; + pFieldInfo.uiType = HB_FT_TIMESTAMP; + break; default: - /* HB_TRACE( HB_TR_ALWAYS, ("new sql type=%d", iDataType) ); */ - bError = HB_TRUE; - errCode = ( HB_ERRCODE ) iDataType; - pFieldInfo.uiType = 0; - pFieldInfo.uiType = HB_FT_STRING; - break; + /* HB_TRACE( HB_TR_ALWAYS, ("new sql type=%d", iDataType) ); */ + bError = HB_TRUE; + errCode = ( HB_ERRCODE ) iDataType; + pFieldInfo.uiType = 0; + pFieldInfo.uiType = HB_FT_STRING; + break; } if ( ! bError )