From 6504b7dec0e10fc258eebc78a85835c7842db4ca Mon Sep 17 00:00:00 2001 From: cas Date: Fri, 5 Nov 1999 18:28:10 +0000 Subject: [PATCH] No comments --- src/WOKUnix/FILES | 1 - src/WOKUnix/WOKUnix_FDescr.cxx | 16 +++++----------- src/WOKUnix/WOKUnix_FileBuffer.cxx | 15 ++++++++++----- src/WOKUnix/WOKUnix_Path.cxx | 8 ++++---- src/WOKUnix/WOKUnix_PathIterator.cxx | 2 +- src/WOKUnix/WOKUnix_Process.cxx | 1 + src/WOKUnix/WOKUnix_RegExp.cxx | 4 ++-- src/WOKUnix/WOKUnix_RemoteShell.cxx | 2 ++ src/WOKUnix/WOKUnix_Shell.cxx | 6 ++++-- src/WOKUnix/WOKUnix_ShellStatus.cxx | 1 + src/WOKUnix/WOKUnix_Signal.cxx | 2 ++ src/WOKUnix/WOKUnix_regexp_1.c | 7 ++++++- 12 files changed, 38 insertions(+), 27 deletions(-) diff --git a/src/WOKUnix/FILES b/src/WOKUnix/FILES index 5bcfc1d..325ffd6 100755 --- a/src/WOKUnix/FILES +++ b/src/WOKUnix/FILES @@ -5,7 +5,6 @@ WOKUnix_SigHandler.hxx WOKUnix_MaxPipeSize.hxx WOKUnix_regexp.h WOKUnix_regexp_1.c -WOKUnix_WOKSteps.edl WOKUnix_CMPLRS.edl WOKUnix_StatBuf.hxx WOKUnix_Dir.hxx diff --git a/src/WOKUnix/WOKUnix_FDescr.cxx b/src/WOKUnix/WOKUnix_FDescr.cxx index 20b913c..c360f5a 100755 --- a/src/WOKUnix/WOKUnix_FDescr.cxx +++ b/src/WOKUnix/WOKUnix_FDescr.cxx @@ -291,9 +291,9 @@ Handle(TCollection_HAsciiString) WOKUnix_FDescr::ReadLine() { Handle(TCollection_HAsciiString) astr; - if(myFILE == NULL) + if(myFILE != NULL) { - TCollection_AsciiString abuf; + TCollection_AsciiString abuf ( 1024 ); Standard_Integer nbread = 0; while(IsAtEnd() == Standard_False) @@ -321,7 +321,7 @@ Handle(TCollection_HAsciiString) WOKUnix_FDescr::ReadLine() } else { - TCollection_AsciiString abuf; + TCollection_AsciiString abuf ( 1024 ); Standard_Integer nbread = 0; while(GetNbToRead() != 0) @@ -407,17 +407,11 @@ WOKUnix_FDescr WOKUnix_FDescr::Stderr() #ifdef LIN static FILE* _wokunix_fdopen ( int fd ) { - char* fdMode; - int mode = fcntl ( fd, F_GETFL ); + char* fdMode = "r"; + int mode = fcntl ( fd, F_GETFL ); switch ( mode & O_ACCMODE ) { - case O_RDONLY: - - fdMode = "r"; - - break; - case O_WRONLY: fdMode = "w"; diff --git a/src/WOKUnix/WOKUnix_FileBuffer.cxx b/src/WOKUnix/WOKUnix_FileBuffer.cxx index e32b458..01f0ddd 100755 --- a/src/WOKUnix/WOKUnix_FileBuffer.cxx +++ b/src/WOKUnix/WOKUnix_FileBuffer.cxx @@ -55,7 +55,6 @@ Handle(TColStd_HSequenceOfHAsciiString) WOKUnix_FileBuffer::Echo() if(mybuffer.FileNo() != -1) { Handle(TColStd_HSequenceOfHAsciiString) aseq = new TColStd_HSequenceOfHAsciiString; - Standard_Integer nbread; mybuffer.Reset(); @@ -65,7 +64,11 @@ Handle(TColStd_HSequenceOfHAsciiString) WOKUnix_FileBuffer::Echo() while(mybuffer.IsAtEnd() == Standard_False) { - aseq->Append(mybuffer.ReadLine()); + Handle( TCollection_HAsciiString ) str = mybuffer.ReadLine (); + + if ( !str.IsNull () && !str -> IsEmpty () ) + + aseq -> Append ( str ); } aseq->Append(WOKUnix_Buffer::Echo()); @@ -83,14 +86,16 @@ Handle(TColStd_HSequenceOfHAsciiString) WOKUnix_FileBuffer::Echo() //======================================================================= void WOKUnix_FileBuffer::Acquit(const Standard_Integer astatus, const WOKUnix_FDSet& aset) { +#ifndef LIN Standard_Integer nbtoread = GetFDescr().GetNbToRead(); - -#ifdef WOK_VERBOSE +#endif // LIN +#if defined( WOK_VERBOSE ) && !defined( LIN ) VerboseMsg("WOK_PROCESS") << "WOKUnix_FileBuffer::Acquit" << "There is " << nbtoread << " bytes to read on process output" << endm; #endif - +#ifndef LIN if(nbtoread >= MAX_PIPE_SIZE) +#endif // LIN { Dump(); } diff --git a/src/WOKUnix/WOKUnix_Path.cxx b/src/WOKUnix/WOKUnix_Path.cxx index 13765da..c5de9e8 100755 --- a/src/WOKUnix/WOKUnix_Path.cxx +++ b/src/WOKUnix/WOKUnix_Path.cxx @@ -11,10 +11,6 @@ #include #include -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - #include #include @@ -25,6 +21,10 @@ #include +#ifndef PATH_MAX +# define PATH_MAX 1024 +#endif // end PATH_MAX + //======================================================================= //function : WOKUnix_Path //purpose : Empty Contructor diff --git a/src/WOKUnix/WOKUnix_PathIterator.cxx b/src/WOKUnix/WOKUnix_PathIterator.cxx index 3614f25..0c7fd28 100755 --- a/src/WOKUnix/WOKUnix_PathIterator.cxx +++ b/src/WOKUnix/WOKUnix_PathIterator.cxx @@ -17,7 +17,7 @@ WOKUnix_PathIterator::WOKUnix_PathIterator(const Handle(WOKUnix_Path)& apath, const Standard_Boolean abool, const Standard_CString amask) -: mypath(apath), myrecflag(abool), mymask(amask) +: mymask(amask), mypath(apath), myrecflag(abool) { TCollection_HAsciiString mask; mask.AssignCat(apath->Name()->ToCString()); diff --git a/src/WOKUnix/WOKUnix_Process.cxx b/src/WOKUnix/WOKUnix_Process.cxx index 0308f80..a9cab06 100755 --- a/src/WOKUnix/WOKUnix_Process.cxx +++ b/src/WOKUnix/WOKUnix_Process.cxx @@ -16,6 +16,7 @@ #include #include #include +#include #include diff --git a/src/WOKUnix/WOKUnix_RegExp.cxx b/src/WOKUnix/WOKUnix_RegExp.cxx index 6573d66..643a096 100755 --- a/src/WOKUnix/WOKUnix_RegExp.cxx +++ b/src/WOKUnix/WOKUnix_RegExp.cxx @@ -56,7 +56,7 @@ void WOKUnix_RegExp :: SetPattern ( const Standard_Integer aTblLen ) { - int syntax; + int syntax = RE_SYNTAX_AWK; _TCHAR* errMsg; Destroy (); @@ -85,7 +85,7 @@ void WOKUnix_RegExp :: SetPattern ( switch ( aSyntax ) { case WOKUnix_RESyntaxAWK: - syntax = RE_SYNTAX_AWK; + break; case WOKUnix_RESyntaxEGREP: diff --git a/src/WOKUnix/WOKUnix_RemoteShell.cxx b/src/WOKUnix/WOKUnix_RemoteShell.cxx index ddd5c0c..c5f668f 100755 --- a/src/WOKUnix/WOKUnix_RemoteShell.cxx +++ b/src/WOKUnix/WOKUnix_RemoteShell.cxx @@ -15,6 +15,8 @@ #include #include #endif + +#include #include #include diff --git a/src/WOKUnix/WOKUnix_Shell.cxx b/src/WOKUnix/WOKUnix_Shell.cxx index 6e762c0..087e0f8 100755 --- a/src/WOKUnix/WOKUnix_Shell.cxx +++ b/src/WOKUnix/WOKUnix_Shell.cxx @@ -13,6 +13,7 @@ #endif #include +#include #include @@ -41,7 +42,8 @@ static char *ShellArgv[] = {"/bin/csh", "-f", NULL}; WOKUnix_Shell::WOKUnix_Shell(const WOKUnix_ShellMode amode, const WOKUnix_PopenOutputMode outmode, const WOKUnix_PopenBufferMode bufmode) -: WOKUnix_Process(3, ShellArgv, outmode, bufmode, -1), mymode(amode), myecho(Standard_False), mylocked(Standard_False) +: WOKUnix_Process(3, ShellArgv, outmode, bufmode, -1), + mymode(amode), mylocked(Standard_False), myecho(Standard_False) { switch(amode) { @@ -66,7 +68,7 @@ WOKUnix_Shell::WOKUnix_Shell(const TCollection_AsciiString& apath, const WOKUnix_ShellMode amode, const WOKUnix_PopenOutputMode outmode, const WOKUnix_PopenBufferMode bufmode) -: WOKUnix_Process(3, ShellArgv, outmode, bufmode, -1), mymode(amode), myecho(Standard_False), mylocked(Standard_False) +: WOKUnix_Process(3, ShellArgv, outmode, bufmode, -1), mymode(amode), mylocked(Standard_False), myecho(Standard_False) { switch(amode) { diff --git a/src/WOKUnix/WOKUnix_ShellStatus.cxx b/src/WOKUnix/WOKUnix_ShellStatus.cxx index 48fb864..c4aaa2c 100755 --- a/src/WOKUnix/WOKUnix_ShellStatus.cxx +++ b/src/WOKUnix/WOKUnix_ShellStatus.cxx @@ -1,3 +1,4 @@ +#include #include diff --git a/src/WOKUnix/WOKUnix_Signal.cxx b/src/WOKUnix/WOKUnix_Signal.cxx index 1be1356..2aa3419 100755 --- a/src/WOKUnix/WOKUnix_Signal.cxx +++ b/src/WOKUnix/WOKUnix_Signal.cxx @@ -4,6 +4,7 @@ #include #include +#include #ifdef LIN #include @@ -123,4 +124,5 @@ int WOKUnix_Signal::GetSig(const WOKUnix_Signals asig) case WOKUnix_SIGSEGV : return SIGSEGV; case WOKUnix_SIGCHILD : return SIGCLD; } + return 0; } diff --git a/src/WOKUnix/WOKUnix_regexp_1.c b/src/WOKUnix/WOKUnix_regexp_1.c index 178fe4f..1a5b4cb 100755 --- a/src/WOKUnix/WOKUnix_regexp_1.c +++ b/src/WOKUnix/WOKUnix_regexp_1.c @@ -44,6 +44,7 @@ void *alloca(unsigned int size){return (void *)0L;} #include +#include /***/ /******************************************************************************/ @@ -956,6 +957,8 @@ void re_compile_fastmap ( PRE_PATTERN_BUFFER bufp ) { } /* end if */ break; + + default: break; } /* end switch */ @@ -1357,7 +1360,7 @@ int re_match_2 ( d2 = string2, dend2 = regend[ regno ]; /* end of string1 => advance to string2. */ - } /* end while + } /* end while */ /* At end of register contents => success */ if ( d2 == dend2 ) break; @@ -1679,6 +1682,8 @@ nofinalize: break; + default: break; + } /* end switch */ continue; /* Successfully matched one pattern command; keep matching */ -- 2.39.5