2016-01-15 11:15 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/gtqtc/gtqtc.h
* contrib/gtqtc/gtqtc1.cpp
* renamed few variables to avoid -Wshadow warnings
* contrib/hbfimage/fi_wrp.c
* removed unnecessary ;
* contrib/hbodbc/odbc.c
! replaced '\0' with NULL in pointer initialization
* src/3rd/jpeg/Makefile
% added missing HAVE_UNSIGNED_CHAR build macro. Without it LIBJPEG
uses SHORT to hold unsigned 8 bit integers what increases memory
usage and reduces the speed.
* src/pp/hbpp.c
* minor modification to keep string constant C90 comnpatible
* src/rtl/filesys.c
* simplified DOS to POSIX file attribute translation
+ respect hidden and system file attribute in DOS builds of hb_fsOpenEx()
* src/vm/fm.c
! added yet another missing HB_STACK_TLS_PRELOAD
This commit is contained in:
@@ -10,6 +10,32 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2016-01-15 11:15 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* contrib/gtqtc/gtqtc.h
|
||||
* contrib/gtqtc/gtqtc1.cpp
|
||||
* renamed few variables to avoid -Wshadow warnings
|
||||
|
||||
* contrib/hbfimage/fi_wrp.c
|
||||
* removed unnecessary ;
|
||||
|
||||
* contrib/hbodbc/odbc.c
|
||||
! replaced '\0' with NULL in pointer initialization
|
||||
|
||||
* src/3rd/jpeg/Makefile
|
||||
% added missing HAVE_UNSIGNED_CHAR build macro. Without it LIBJPEG
|
||||
uses SHORT to hold unsigned 8 bit integers what increases memory
|
||||
usage and reduces the speed.
|
||||
|
||||
* src/pp/hbpp.c
|
||||
* minor modification to keep string constant C90 comnpatible
|
||||
|
||||
* src/rtl/filesys.c
|
||||
* simplified DOS to POSIX file attribute translation
|
||||
+ respect hidden and system file attribute in DOS builds of hb_fsOpenEx()
|
||||
|
||||
* src/vm/fm.c
|
||||
! added yet another missing HB_STACK_TLS_PRELOAD
|
||||
|
||||
2016-01-14 19:33 UTC+0100 Viktor Szakats (vszakats users.noreply.github.com)
|
||||
* *
|
||||
% remove brandings and homepage from copyright header. Pass 2 - semi-auto.
|
||||
|
||||
@@ -340,7 +340,7 @@ class QTConsole : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QTConsole( PHB_GTQTC pStructQTC, QWidget *parent = 0 );
|
||||
QTConsole( PHB_GTQTC pStructQTC, QWidget *parnt = 0 );
|
||||
virtual ~QTConsole( void );
|
||||
|
||||
PHB_GTQTC pQTC;
|
||||
@@ -360,20 +360,20 @@ public:
|
||||
void repaintChars( const QRect & rect );
|
||||
|
||||
protected:
|
||||
void inputMethodEvent( QInputMethodEvent * event );
|
||||
void keyPressEvent( QKeyEvent * event );
|
||||
void keyReleaseEvent( QKeyEvent * event );
|
||||
void mousePressEvent( QMouseEvent * event );
|
||||
void mouseMoveEvent( QMouseEvent * event );
|
||||
void mouseReleaseEvent( QMouseEvent * event );
|
||||
void mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void paintEvent( QPaintEvent * event );
|
||||
void resizeEvent( QResizeEvent * event );
|
||||
void wheelEvent( QWheelEvent * event );
|
||||
void timerEvent( QTimerEvent * event );
|
||||
void focusInEvent( QFocusEvent * event );
|
||||
void focusOutEvent( QFocusEvent * event );
|
||||
bool event( QEvent * event );
|
||||
void inputMethodEvent( QInputMethodEvent * evt );
|
||||
void keyPressEvent( QKeyEvent * evt );
|
||||
void keyReleaseEvent( QKeyEvent * evt );
|
||||
void mousePressEvent( QMouseEvent * evt );
|
||||
void mouseMoveEvent( QMouseEvent * evt );
|
||||
void mouseReleaseEvent( QMouseEvent * evt );
|
||||
void mouseDoubleClickEvent( QMouseEvent * evt );
|
||||
void paintEvent( QPaintEvent * evt );
|
||||
void resizeEvent( QResizeEvent * evt );
|
||||
void wheelEvent( QWheelEvent * evt );
|
||||
void timerEvent( QTimerEvent * evt );
|
||||
void focusInEvent( QFocusEvent * evt );
|
||||
void focusOutEvent( QFocusEvent * evt );
|
||||
bool event( QEvent * evt );
|
||||
};
|
||||
|
||||
|
||||
@@ -390,7 +390,7 @@ public:
|
||||
void setResizing( void );
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent * event );
|
||||
void closeEvent( QCloseEvent * evt );
|
||||
};
|
||||
|
||||
#endif /* HB_QTC_H_ */
|
||||
|
||||
@@ -2544,7 +2544,7 @@ HB_CALL_ON_STARTUP_END( _hb_startup_gt_Init_ )
|
||||
|
||||
/* *********************************************************************** */
|
||||
|
||||
QTConsole::QTConsole( PHB_GTQTC pStructQTC, QWidget *parent ) : QWidget( parent )
|
||||
QTConsole::QTConsole( PHB_GTQTC pStructQTC, QWidget *parnt ) : QWidget( parnt )
|
||||
{
|
||||
pQTC = pStructQTC;
|
||||
|
||||
@@ -2718,7 +2718,7 @@ void QTConsole::setImageSize( void )
|
||||
}
|
||||
}
|
||||
|
||||
void QTConsole::resizeEvent( QResizeEvent * event )
|
||||
void QTConsole::resizeEvent( QResizeEvent * evt )
|
||||
{
|
||||
int iWidth = width();
|
||||
int iHeight = height();
|
||||
@@ -2741,7 +2741,7 @@ void QTConsole::resizeEvent( QResizeEvent * event )
|
||||
update();
|
||||
}
|
||||
else
|
||||
QWidget::resizeEvent( event );
|
||||
QWidget::resizeEvent( evt );
|
||||
}
|
||||
|
||||
static QRect hb_gt_qtc_cellToPixel( PHB_GTQTC pQTC, const QRect & rc )
|
||||
@@ -2891,10 +2891,10 @@ void QTConsole::repaintChars( const QRect & rx )
|
||||
update( rx.translated( pQTC->marginLeft, pQTC->marginTop ) );
|
||||
}
|
||||
|
||||
void QTConsole::paintEvent( QPaintEvent * event )
|
||||
void QTConsole::paintEvent( QPaintEvent * evt )
|
||||
{
|
||||
QPainter painter( this );
|
||||
QRect rEvt = event->rect();
|
||||
QRect rEvt = evt->rect();
|
||||
|
||||
if( rEvt.left() < pQTC->marginLeft )
|
||||
{
|
||||
@@ -2975,9 +2975,9 @@ void QTConsole::paintEvent( QPaintEvent * event )
|
||||
}
|
||||
}
|
||||
|
||||
void QTConsole::timerEvent( QTimerEvent * event )
|
||||
void QTConsole::timerEvent( QTimerEvent * evt )
|
||||
{
|
||||
if( event->timerId() == timer->timerId() )
|
||||
if( evt->timerId() == timer->timerId() )
|
||||
{
|
||||
if( hasFocus() )
|
||||
{
|
||||
@@ -2986,58 +2986,58 @@ void QTConsole::timerEvent( QTimerEvent * event )
|
||||
}
|
||||
}
|
||||
else
|
||||
QWidget::timerEvent( event );
|
||||
QWidget::timerEvent( evt );
|
||||
}
|
||||
|
||||
void QTConsole::focusInEvent( QFocusEvent * event )
|
||||
void QTConsole::focusInEvent( QFocusEvent * evt )
|
||||
{
|
||||
hb_gt_qtc_addKeyToInputQueue( pQTC, HB_K_GOTFOCUS );
|
||||
QWidget::focusInEvent( event );
|
||||
QWidget::focusInEvent( evt );
|
||||
#if defined( HB_OS_ANDROID ) || defined( HB_OS_IOS ) || defined( HB_OS_WIN_CE )
|
||||
QEvent reqSIPevent( QEvent::RequestSoftwareInputPanel );
|
||||
QApplication::sendEvent( pQTC->qWnd, &reqSIPevent );
|
||||
#endif
|
||||
}
|
||||
|
||||
void QTConsole::focusOutEvent( QFocusEvent * event )
|
||||
void QTConsole::focusOutEvent( QFocusEvent * evt )
|
||||
{
|
||||
hb_gt_qtc_addKeyToInputQueue( pQTC, HB_K_LOSTFOCUS );
|
||||
QWidget::focusOutEvent( event );
|
||||
QWidget::focusOutEvent( evt );
|
||||
}
|
||||
|
||||
void QTConsole::mouseMoveEvent( QMouseEvent * event )
|
||||
void QTConsole::mouseMoveEvent( QMouseEvent * evt )
|
||||
{
|
||||
if( pQTC->fSelectCopy &&
|
||||
( event->buttons() & Qt::LeftButton ) &&
|
||||
( event->modifiers() & Qt::ShiftModifier ) )
|
||||
( evt->buttons() & Qt::LeftButton ) &&
|
||||
( evt->modifiers() & Qt::ShiftModifier ) )
|
||||
{
|
||||
if( ! selectMode )
|
||||
{
|
||||
selectMode = true;
|
||||
selectRect.setCoords( event->x(), event->y(), event->x(), event->y() );
|
||||
selectRect.setCoords( evt->x(), evt->y(), evt->x(), evt->y() );
|
||||
update( hb_gt_qtc_unmapRect( pQTC, hb_gt_qtc_mapRect( pQTC, image, selectRect ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
QRect rSel1 = hb_gt_qtc_unmapRect( pQTC, hb_gt_qtc_mapRect( pQTC, image, selectRect ) );
|
||||
selectRect.setBottomRight( event->pos() );
|
||||
selectRect.setBottomRight( evt->pos() );
|
||||
QRect rSel2 = hb_gt_qtc_unmapRect( pQTC, hb_gt_qtc_mapRect( pQTC, image, selectRect ) );
|
||||
if( rSel1 != rSel2 )
|
||||
update( QRegion( rSel1 ).xored( QRegion( rSel2 ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
hb_gt_qtc_setMouseKey( pQTC, event->x(), event->y(), 0, event->modifiers() );
|
||||
hb_gt_qtc_setMouseKey( pQTC, evt->x(), evt->y(), 0, evt->modifiers() );
|
||||
}
|
||||
|
||||
void QTConsole::wheelEvent( QWheelEvent * event )
|
||||
void QTConsole::wheelEvent( QWheelEvent * evt )
|
||||
{
|
||||
int iKey;
|
||||
|
||||
switch( event->orientation() )
|
||||
switch( evt->orientation() )
|
||||
{
|
||||
case Qt::Vertical:
|
||||
if( event->delta() < 0 )
|
||||
if( evt->delta() < 0 )
|
||||
iKey = K_MWBACKWARD;
|
||||
else
|
||||
iKey = K_MWFORWARD;
|
||||
@@ -3046,18 +3046,18 @@ void QTConsole::wheelEvent( QWheelEvent * event )
|
||||
case Qt::Horizontal:
|
||||
/* TODO? add support for horizontal wheels */
|
||||
default:
|
||||
QWidget::wheelEvent( event );
|
||||
QWidget::wheelEvent( evt );
|
||||
return;
|
||||
}
|
||||
|
||||
hb_gt_qtc_setMouseKey( pQTC, event->x(), event->y(), iKey, event->modifiers() );
|
||||
hb_gt_qtc_setMouseKey( pQTC, evt->x(), evt->y(), iKey, evt->modifiers() );
|
||||
}
|
||||
|
||||
void QTConsole::mouseDoubleClickEvent( QMouseEvent * event )
|
||||
void QTConsole::mouseDoubleClickEvent( QMouseEvent * evt )
|
||||
{
|
||||
int iKey;
|
||||
|
||||
switch( event->button() )
|
||||
switch( evt->button() )
|
||||
{
|
||||
case Qt::LeftButton:
|
||||
#if defined( HB_OS_ANDROID ) || defined( HB_OS_IOS ) || defined( HB_OS_WIN_CE )
|
||||
@@ -3078,18 +3078,18 @@ void QTConsole::mouseDoubleClickEvent( QMouseEvent * event )
|
||||
break;
|
||||
|
||||
default:
|
||||
QWidget::mouseDoubleClickEvent( event );
|
||||
QWidget::mouseDoubleClickEvent( evt );
|
||||
return;
|
||||
}
|
||||
|
||||
hb_gt_qtc_setMouseKey( pQTC, event->x(), event->y(), iKey, event->modifiers() );
|
||||
hb_gt_qtc_setMouseKey( pQTC, evt->x(), evt->y(), iKey, evt->modifiers() );
|
||||
}
|
||||
|
||||
void QTConsole::mousePressEvent( QMouseEvent * event )
|
||||
void QTConsole::mousePressEvent( QMouseEvent * evt )
|
||||
{
|
||||
int iKey;
|
||||
|
||||
switch( event->button() )
|
||||
switch( evt->button() )
|
||||
{
|
||||
case Qt::LeftButton:
|
||||
iKey = K_LBUTTONDOWN;
|
||||
@@ -3104,18 +3104,18 @@ void QTConsole::mousePressEvent( QMouseEvent * event )
|
||||
break;
|
||||
|
||||
default:
|
||||
QWidget::mousePressEvent( event );
|
||||
QWidget::mousePressEvent( evt );
|
||||
return;
|
||||
}
|
||||
|
||||
hb_gt_qtc_setMouseKey( pQTC, event->x(), event->y(), iKey, event->modifiers() );
|
||||
hb_gt_qtc_setMouseKey( pQTC, evt->x(), evt->y(), iKey, evt->modifiers() );
|
||||
}
|
||||
|
||||
void QTConsole::mouseReleaseEvent( QMouseEvent * event )
|
||||
void QTConsole::mouseReleaseEvent( QMouseEvent * evt )
|
||||
{
|
||||
int iKey;
|
||||
|
||||
switch( event->button() )
|
||||
switch( evt->button() )
|
||||
{
|
||||
case Qt::LeftButton:
|
||||
iKey = K_LBUTTONUP;
|
||||
@@ -3130,18 +3130,18 @@ void QTConsole::mouseReleaseEvent( QMouseEvent * event )
|
||||
break;
|
||||
|
||||
default:
|
||||
QWidget::mouseReleaseEvent( event );
|
||||
QWidget::mouseReleaseEvent( evt );
|
||||
return;
|
||||
}
|
||||
|
||||
hb_gt_qtc_setMouseKey( pQTC, event->x(), event->y(), iKey, event->modifiers() );
|
||||
hb_gt_qtc_setMouseKey( pQTC, evt->x(), evt->y(), iKey, evt->modifiers() );
|
||||
}
|
||||
|
||||
bool QTConsole::event( QEvent * event )
|
||||
bool QTConsole::event( QEvent * evt )
|
||||
{
|
||||
if( resizeMode )
|
||||
{
|
||||
switch( event->type() )
|
||||
switch( evt->type() )
|
||||
{
|
||||
case QEvent::Enter:
|
||||
case QEvent::Leave:
|
||||
@@ -3159,14 +3159,14 @@ bool QTConsole::event( QEvent * event )
|
||||
}
|
||||
}
|
||||
|
||||
return QWidget::event( event );
|
||||
return QWidget::event( evt );
|
||||
}
|
||||
|
||||
void QTConsole::inputMethodEvent( QInputMethodEvent * event )
|
||||
void QTConsole::inputMethodEvent( QInputMethodEvent * evt )
|
||||
{
|
||||
/* It's for SoftwareInputPanel in Andorid. */
|
||||
|
||||
QString qStr = event->commitString();
|
||||
QString qStr = evt->commitString();
|
||||
|
||||
if( qStr.size() > 0 )
|
||||
{
|
||||
@@ -3175,29 +3175,29 @@ void QTConsole::inputMethodEvent( QInputMethodEvent * event )
|
||||
HB_WCHAR wc = qStr[ i ].unicode();
|
||||
hb_gt_qtc_addKeyToInputQueue( pQTC, HB_INKEY_NEW_UNICODE( wc ) );
|
||||
}
|
||||
event->accept();
|
||||
evt->accept();
|
||||
}
|
||||
else
|
||||
QWidget::inputMethodEvent( event );
|
||||
QWidget::inputMethodEvent( evt );
|
||||
}
|
||||
|
||||
void QTConsole::keyReleaseEvent( QKeyEvent * event )
|
||||
void QTConsole::keyReleaseEvent( QKeyEvent * evt )
|
||||
{
|
||||
if( selectMode && ( event->modifiers() & Qt::ShiftModifier ) == 0 )
|
||||
if( selectMode && ( evt->modifiers() & Qt::ShiftModifier ) == 0 )
|
||||
copySelection();
|
||||
|
||||
QWidget::keyReleaseEvent( event );
|
||||
QWidget::keyReleaseEvent( evt );
|
||||
}
|
||||
|
||||
void QTConsole::keyPressEvent( QKeyEvent * event )
|
||||
void QTConsole::keyPressEvent( QKeyEvent * evt )
|
||||
{
|
||||
int iKey = 0, iFlags = hb_gt_qtc_getKeyFlags( event->modifiers() ),
|
||||
int iKey = 0, iFlags = hb_gt_qtc_getKeyFlags( evt->modifiers() ),
|
||||
iSize, i;
|
||||
|
||||
/* support for national characters */
|
||||
if( ( iSize = event->text().size() ) > 0 )
|
||||
if( ( iSize = evt->text().size() ) > 0 )
|
||||
{
|
||||
QString qStr = event->text();
|
||||
QString qStr = evt->text();
|
||||
HB_WCHAR wc = qStr[ 0 ].unicode();
|
||||
|
||||
if( iSize > 1 || ( wc >= 32 && wc != 127 ) )
|
||||
@@ -3215,7 +3215,7 @@ void QTConsole::keyPressEvent( QKeyEvent * event )
|
||||
}
|
||||
}
|
||||
|
||||
switch( event->key() )
|
||||
switch( evt->key() )
|
||||
{
|
||||
case Qt::Key_F1:
|
||||
iKey = HB_KX_F1;
|
||||
@@ -3533,7 +3533,7 @@ void QTConsole::keyPressEvent( QKeyEvent * event )
|
||||
if( iKey != 0 )
|
||||
hb_gt_qtc_addKeyToInputQueue( pQTC, HB_INKEY_NEW_KEY( iKey, iFlags ) );
|
||||
else
|
||||
QWidget::keyPressEvent( event );
|
||||
QWidget::keyPressEvent( evt );
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
@@ -3584,14 +3584,14 @@ QTCWindow::~QTCWindow( void )
|
||||
delete qConsole;
|
||||
}
|
||||
|
||||
void QTCWindow::closeEvent( QCloseEvent * event )
|
||||
void QTCWindow::closeEvent( QCloseEvent * evt )
|
||||
{
|
||||
if( qConsole->pQTC->iCloseMode == 0 )
|
||||
hb_vmRequestQuit();
|
||||
else
|
||||
hb_gt_qtc_addKeyToInputQueue( qConsole->pQTC, HB_K_CLOSE );
|
||||
|
||||
event->ignore();
|
||||
evt->ignore();
|
||||
}
|
||||
|
||||
void QTCWindow::setWindowSize( void )
|
||||
|
||||
@@ -1218,7 +1218,7 @@ HB_FUNC( FI_CONVERTTOTYPE )
|
||||
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id); */
|
||||
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type); */
|
||||
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count); */
|
||||
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length) */;
|
||||
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length) */
|
||||
/* DLL_API BOOL DLL_CALLCONV FreeImage_SetTagValue(FITAG *tag, const void *value); */
|
||||
|
||||
/* iterator */
|
||||
|
||||
@@ -1083,7 +1083,7 @@ HB_FUNC( SQLGETCONNECTATTR ) /* hDbc, nOption, @cOption */
|
||||
#if ODBCVER >= 0x0300
|
||||
SQLPOINTER buffer[ 512 ];
|
||||
SQLINTEGER lLen = 0;
|
||||
buffer[ 0 ] = '\0';
|
||||
buffer[ 0 ] = NULL;
|
||||
hb_retni( SQLGetConnectAttr( hDbc,
|
||||
( SQLINTEGER ) hb_parnl( 2 ),
|
||||
( SQLPOINTER ) buffer,
|
||||
@@ -1112,7 +1112,7 @@ HB_FUNC( SQLGETSTMTATTR ) /* hStmt, nOption, @cOption */
|
||||
#if ODBCVER >= 0x0300
|
||||
SQLPOINTER buffer[ 512 ];
|
||||
SQLINTEGER lLen = 0;
|
||||
buffer[ 0 ] = '\0';
|
||||
buffer[ 0 ] = NULL;
|
||||
hb_retni( SQLGetStmtAttr( hStmt,
|
||||
( SQLINTEGER ) hb_parnl( 2 ),
|
||||
( SQLPOINTER ) buffer,
|
||||
|
||||
@@ -85,7 +85,7 @@ ifeq ($(filter $(HB_COMPILER),<>),)
|
||||
include $(TOP)$(ROOT)config/detfun.mk
|
||||
|
||||
ifneq ($(HB_HAS_JPEG_LOCAL),)
|
||||
HB_CFLAGS += -DHAVE_STDLIB_H -DHAVE_PROTOTYPES
|
||||
HB_CFLAGS += -DHAVE_STDLIB_H -DHAVE_PROTOTYPES -DHAVE_UNSIGNED_CHAR
|
||||
ifeq ($(HB_COMPILER),poccarm)
|
||||
HB_CFLAGS += -DNO_GETENV
|
||||
endif
|
||||
|
||||
@@ -663,8 +663,8 @@ static void hb_pp_usage( char * szName )
|
||||
" -o<file> \tcreates .c file with PP rules\n"
|
||||
" -v<file> \tcreates .h file with version information\n"
|
||||
" -w \twrite preprocessed (.ppo) file\n"
|
||||
" -q[012] \tdisable information messages\n"
|
||||
"\n"
|
||||
" -q[012] \tdisable information messages\n" );
|
||||
printf( "\n"
|
||||
"Note: if neither -o nor -v is specified then -w is default action\n\n" );
|
||||
}
|
||||
|
||||
|
||||
@@ -584,19 +584,13 @@ static void convert_open_flags( HB_BOOL fCreate, HB_FATTR nAttr, HB_USHORT uiFla
|
||||
*mode = HB_FA_POSIX_ATTR( nAttr );
|
||||
if( *mode == 0 )
|
||||
{
|
||||
*mode = ( nAttr & FC_HIDDEN ) ? S_IRUSR : ( S_IRUSR | S_IRGRP | S_IROTH );
|
||||
if( ! ( nAttr & FC_READONLY ) )
|
||||
{
|
||||
if( *mode & S_IRUSR ) *mode |= S_IWUSR;
|
||||
if( *mode & S_IRGRP ) *mode |= S_IWGRP;
|
||||
if( *mode & S_IROTH ) *mode |= S_IWOTH;
|
||||
}
|
||||
if( nAttr & FC_SYSTEM )
|
||||
{
|
||||
if( *mode & S_IRUSR ) *mode |= S_IXUSR;
|
||||
if( *mode & S_IRGRP ) *mode |= S_IXGRP;
|
||||
if( *mode & S_IROTH ) *mode |= S_IXOTH;
|
||||
}
|
||||
*mode = S_IRUSR | S_IRGRP | S_IROTH;
|
||||
if( ! ( nAttr & HB_FA_READONLY ) )
|
||||
*mode |= S_IWUSR | S_IWGRP | S_IWOTH;
|
||||
if( nAttr & HB_FA_SYSTEM )
|
||||
*mode |= S_IXUSR | S_IXGRP | S_IXOTH;
|
||||
if( nAttr & HB_FA_HIDDEN )
|
||||
*mode &= S_IRUSR | S_IWUSR | S_IXUSR;
|
||||
}
|
||||
#else
|
||||
*mode = S_IREAD |
|
||||
@@ -605,11 +599,9 @@ static void convert_open_flags( HB_BOOL fCreate, HB_FATTR nAttr, HB_USHORT uiFla
|
||||
#endif
|
||||
|
||||
/* dos file attributes */
|
||||
#if defined( HB_FS_DOSCREAT )
|
||||
#if defined( HB_OS_DOS )
|
||||
if( nAttr == FC_NORMAL )
|
||||
{
|
||||
*attr = _A_NORMAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
*attr = _A_ARCH;
|
||||
@@ -1480,7 +1472,14 @@ HB_FHANDLE hb_fsOpenEx( const char * pszFileName, HB_FATTR nAttr, HB_USHORT uiFl
|
||||
convert_open_flags( HB_FALSE, nAttr, uiFlags, &flags, &mode, &share, &attr );
|
||||
|
||||
hb_vmUnlock();
|
||||
#if defined( _MSC_VER ) || defined( __DMC__ )
|
||||
|
||||
#if defined( HB_OS_DOS )
|
||||
if( ( nAttr & ( FC_HIDDEN | FC_SYSTEM ) ) == 0 ||
|
||||
access( pszFileName, F_OK ) == 0 )
|
||||
attr = 0;
|
||||
#endif
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
if( share )
|
||||
hFileHandle = _sopen( pszFileName, flags, share, mode );
|
||||
else
|
||||
@@ -1495,6 +1494,16 @@ HB_FHANDLE hb_fsOpenEx( const char * pszFileName, HB_FATTR nAttr, HB_USHORT uiFl
|
||||
#else
|
||||
HB_FAILURE_RETRY( hFileHandle, open( pszFileName, flags | share, mode ) );
|
||||
#endif
|
||||
|
||||
#if defined( HB_OS_DOS )
|
||||
if( attr != 0 && hFileHandle != ( HB_FHANDLE ) FS_ERROR )
|
||||
# if defined( __DJGPP__ ) || defined( __BORLANDC__ )
|
||||
_chmod( pszFileName, 1, attr );
|
||||
# else
|
||||
_dos_setfileattr( pszFileName, attr );
|
||||
# endif
|
||||
#endif
|
||||
|
||||
hb_vmLock();
|
||||
|
||||
if( pszFree )
|
||||
@@ -2228,19 +2237,13 @@ HB_BOOL hb_fsSetAttr( const char * pszFileName, HB_FATTR nAttr )
|
||||
int iAttr = HB_FA_POSIX_ATTR( nAttr ), iResult;
|
||||
if( iAttr == 0 )
|
||||
{
|
||||
iAttr = ( nAttr & HB_FA_HIDDEN ) ? S_IRUSR : ( S_IRUSR | S_IRGRP | S_IROTH );
|
||||
iAttr = S_IRUSR | S_IRGRP | S_IROTH;
|
||||
if( ! ( nAttr & HB_FA_READONLY ) )
|
||||
{
|
||||
if( iAttr & S_IRUSR ) iAttr |= S_IWUSR;
|
||||
if( iAttr & S_IRGRP ) iAttr |= S_IWGRP;
|
||||
if( iAttr & S_IROTH ) iAttr |= S_IWOTH;
|
||||
}
|
||||
iAttr |= S_IWUSR | S_IWGRP | S_IWOTH;
|
||||
if( nAttr & HB_FA_SYSTEM )
|
||||
{
|
||||
if( iAttr & S_IRUSR ) iAttr |= S_IXUSR;
|
||||
if( iAttr & S_IRGRP ) iAttr |= S_IXGRP;
|
||||
if( iAttr & S_IROTH ) iAttr |= S_IXOTH;
|
||||
}
|
||||
iAttr |= S_IXUSR | S_IXGRP | S_IXOTH;
|
||||
if( nAttr & HB_FA_HIDDEN )
|
||||
iAttr &= S_IRUSR | S_IWUSR | S_IXUSR;
|
||||
}
|
||||
HB_FAILURE_RETRY( iResult, chmod( pszFileName, iAttr ) );
|
||||
fResult = iResult != -1;
|
||||
|
||||
10
src/vm/fm.c
10
src/vm/fm.c
@@ -1545,10 +1545,9 @@ HB_BOOL hb_xtraced( void )
|
||||
|
||||
HB_FUNC( __FM_ALLOCLIMIT )
|
||||
{
|
||||
#if defined( HB_FM_DLMT_ALLOC )
|
||||
HB_STACK_TLS_PRELOAD;
|
||||
|
||||
hb_xclean();
|
||||
#if defined( HB_FM_DLMT_ALLOC )
|
||||
hb_retns( mspace_footprint_limit( hb_mspace() ) );
|
||||
if( HB_ISNUM( 1 ) )
|
||||
{
|
||||
@@ -1559,9 +1558,6 @@ HB_FUNC( __FM_ALLOCLIMIT )
|
||||
mspace_set_footprint_limit( hb_mspace(), nLimit );
|
||||
}
|
||||
#elif defined( HB_FM_DL_ALLOC )
|
||||
HB_STACK_TLS_PRELOAD;
|
||||
|
||||
hb_xclean();
|
||||
hb_retns( dlmalloc_footprint_limit() );
|
||||
if( HB_ISNUM( 1 ) )
|
||||
{
|
||||
@@ -1572,9 +1568,6 @@ HB_FUNC( __FM_ALLOCLIMIT )
|
||||
dlmalloc_set_footprint_limit( ( size_t ) nLimit );
|
||||
}
|
||||
#elif defined( HB_FM_STATISTICS )
|
||||
HB_STACK_TLS_PRELOAD;
|
||||
|
||||
hb_xclean();
|
||||
hb_retns( s_nMemoryLimConsumed ? s_nMemoryLimConsumed : -1 );
|
||||
if( HB_ISNUM( 1 ) )
|
||||
{
|
||||
@@ -1583,7 +1576,6 @@ HB_FUNC( __FM_ALLOCLIMIT )
|
||||
s_nMemoryLimConsumed = HB_MAX( nLimit, 0 );
|
||||
}
|
||||
#else
|
||||
hb_xclean();
|
||||
hb_retni( 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user