2008-07-03 16:48 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* contrib/hbmzip/hbmzip.c
     + Added ".cmd" to the (commented) list of OS/2 executable 
       extensions.
     + Added headers for DOS/GCC line.
     + Guarded new DOS section with GCC guards, added dummy 
       branch for other DOS compilers.
     ! Fixed embedded comment.
     ; TOFIX: 
       ../../hbmzip.c:563: error: 'FILE_ATTRIBUTE_READONLY' undeclared (first use in this function)
       ../../hbmzip.c:568: error: 'FILE_ATTRIBUTE_DIRECTORY' undeclared (first use in this function)

   * contrib/hbmisc/spd.c
     - Removed two __XHARBOUR__ guards, because these feature 
       have since been implemented in xhb.
     ! Fixed DJGPP warning. The problem is that DJGPP will preprocess 
       snprintf() to sprintf() (not very safe), which makes ulMaxBuf 
       var unused.
This commit is contained in:
Viktor Szakats
2008-07-03 14:50:43 +00:00
parent 3e4d3d4dee
commit edff135b13
3 changed files with 56 additions and 12 deletions

View File

@@ -8,6 +8,25 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-07-03 16:48 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbmzip/hbmzip.c
+ Added ".cmd" to the (commented) list of OS/2 executable
extensions.
+ Added headers for DOS/GCC line.
+ Guarded new DOS section with GCC guards, added dummy
branch for other DOS compilers.
! Fixed embedded comment.
; TOFIX:
../../hbmzip.c:563: error: 'FILE_ATTRIBUTE_READONLY' undeclared (first use in this function)
../../hbmzip.c:568: error: 'FILE_ATTRIBUTE_DIRECTORY' undeclared (first use in this function)
* contrib/hbmisc/spd.c
- Removed two __XHARBOUR__ guards, because these feature
have since been implemented in xhb.
! Fixed DJGPP warning. The problem is that DJGPP will preprocess
snprintf() to sprintf() (not very safe), which makes ulMaxBuf
var unused.
2008-07-03 16:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/Makefile
! fixed some contrib library comments: # used before 1-st commented

View File

@@ -70,17 +70,20 @@ static void STAItm( PHB_ITEM pItmPar )
cRes[i++] = *c++;
}
cRes[i++] = '\''; /* cRes[i] = '\0'; */
#ifdef __XHARBOUR__
hb_itemPutCPtr( pItmPar, cRes, i );
#else
hb_itemPutCLPtr( pItmPar, cRes, i );
#endif
}
static ULONG SCItm( char *cBuffer, ULONG ulMaxBuf, char *cParFrm, int iCOut, int IsIndW, int iIndWidth, int IsIndP, int iIndPrec, PHB_ITEM pItmPar )
{
ULONG s;
/* NOTE: In DJGPP (4.2.3) snprintf() will be preprocessed to sprintf(), which
makes ulMaxBuf unused, and this in turn causes a warning, so we're
manually suppressing it. [vszakats] */
#if defined(__DJGPP__)
HB_SYMBOL_UNUSED( ulMaxBuf );
#endif
if( IsIndW && IsIndP ){
switch( iCOut ){
case 'p':
@@ -176,10 +179,6 @@ static ULONG SCItm( char *cBuffer, ULONG ulMaxBuf, char *cParFrm, int iCOut, int
#define DK_INCBUF 512
#define DK_BLKBUF HB_MAX_DOUBLE_LENGTH /* Expense of DK_INCBUF */
#if defined( __XHARBOUR__ ) && ! defined( HB_ERR_FUNCNAME )
#define HB_ERR_FUNCNAME "SQL_SPRINTF"
#endif
HB_FUNC( SQL_SPRINTF )
{
ULONG ulItmFrm;

View File

@@ -68,6 +68,11 @@
#include <unistd.h>
#include <time.h>
#include <utime.h>
#elif defined( HB_OS_DOS )
#if defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__)
#include "hb_io.h"
#include <sys/param.h>
#endif
#endif
@@ -544,6 +549,8 @@ static int hb_zipStoreFile( zipFile hZip, char* szFileName, char* szName, char*
fError = TRUE;
}
#elif defined( HB_OS_DOS )
# if defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__)
{
int iAttr;
@@ -567,7 +574,8 @@ static int hb_zipStoreFile( zipFile hZip, char* szFileName, char* szName, char*
if( ulLen > 4 )
{
pString = &szZipName[ ulLen - 4 ];
if( hb_stricmp( pString, ".exe" ) == 0 || hb_stricmp( pString, ".com" ) == 0 ||
if( hb_stricmp( pString, ".exe" ) == 0 ||
hb_stricmp( pString, ".com" ) == 0 ||
hb_stricmp( pString, ".bat" ) == 0 )
{
ulExtAttr |= 0x00490000; /* --x--x--x */
@@ -577,6 +585,14 @@ static int hb_zipStoreFile( zipFile hZip, char* szFileName, char* szName, char*
else
fError = TRUE;
}
# else
{
int TODO; /* To force warning */
ulExtAttr = 0x81B60020; /* FILE_ATTRIBUTE_ARCHIVE | rw-rw-rw- */
}
# endif
#elif defined( HB_OS_OS2 )
{
FILESTATUS3 fs3;
@@ -608,18 +624,20 @@ static int hb_zipStoreFile( zipFile hZip, char* szFileName, char* szName, char*
else
ulExtAttr |= 0x80000000;
/* Please uncomment it if .exe, .bat and .com are executable files under OS2
#if 0 /* Please enable it if .exe, .bat and .com are executable files under OS2
ulLen = strlen( szZipName );
if( ulLen > 4 )
{
pString = &szZipName[ ulLen - 4 ];
if( hb_stricmp( pString, ".exe" ) == 0 || hb_stricmp( pString, ".com" ) == 0 ||
if( hb_stricmp( pString, ".exe" ) == 0 ||
hb_stricmp( pString, ".com" ) == 0 ||
hb_stricmp( pString, ".cmd" ) == 0 ||
hb_stricmp( pString, ".bat" ) == 0 )
{
ulExtAttr |= 0x00490000; /* --x--x--x */
}
}
*/
#endif
}
else
fError = TRUE;
@@ -840,9 +858,17 @@ static int hb_unzipExtractCurrentFile( unzFile hUnzip, char* szFileName, char* s
utime( szName, &utim );
}
#elif defined( HB_OS_DOS )
# if defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__)
{
_chmod( szName, 1, ufi.external_fa & 0xFF );
}
# else
{
int TODO; /* To force warning */
}
# endif
#elif defined( HB_OS_OS2 )
{
FILESTATUS3 fs3;