From: <lab...@us...> - 2017-04-10 21:53:36
|
Revision: 1545 http://sourceforge.net/p/opengtoolkit/svn/1545 Author: labviewer Date: 2017-04-10 21:53:34 +0000 (Mon, 10 Apr 2017) Log Message: ----------- Minor code improvement Modified Paths: -------------- trunk/lvpipe/c_source/pipes.c trunk/lvpipe/c_source/pipes.vcproj Modified: trunk/lvpipe/c_source/pipes.c =================================================================== --- trunk/lvpipe/c_source/pipes.c 2017-01-26 20:50:21 UTC (rev 1544) +++ trunk/lvpipe/c_source/pipes.c 2017-04-10 21:53:34 UTC (rev 1545) @@ -27,7 +27,7 @@ #include "hosttype.h" #include "pipes.h" -#if defined(DEBUG) +#if defined(_DEBUG) #if Win32 #if defined(_CVI_DEBUG_) #define DoDebugger() @@ -59,7 +59,8 @@ #define LibAPI __declspec(dllimport) __cdecl #endif -typedef enum { +typedef enum +{ kNone, kReadMode, kWriteMode, @@ -383,8 +384,7 @@ err = Win32ToLVErr(ret); *bytesRead = 0; } - - if (*bytesRead) + else if (*bytesRead) { /* There are some bytes to read, so try to read as much as possible now! */ if (!ReadFile(fd, LStrBuf(*data) + offset, bytesReq - offset, bytesRead, NULL)) @@ -616,6 +616,7 @@ if (!err) CloseHandle(fd); closeRefnum(*lvpipe); + *lvpipe = kNotAMagicCookie; } #elif defined(Unix) if (rmpipe) @@ -629,11 +630,11 @@ if (!err) close(fd); closeRefnum(*lvpipe); + *lvpipe = kNotAMagicCookie; } #else return mgNotImplementd #endif - *lvpipe = kNotAMagicCookie; return err; } Modified: trunk/lvpipe/c_source/pipes.vcproj =================================================================== --- trunk/lvpipe/c_source/pipes.vcproj 2017-01-26 20:50:21 UTC (rev 1544) +++ trunk/lvpipe/c_source/pipes.vcproj 2017-04-10 21:53:34 UTC (rev 1545) @@ -443,10 +443,6 @@ /> </FileConfiguration> </File> - <File - RelativePath=".\pipes.h" - > - </File> </Filter> <Filter Name="Resource Files" @@ -493,6 +489,10 @@ Name="Header Files" Filter="h;hpp;hxx;hm;inl" > + <File + RelativePath=".\pipes.h" + > + </File> </Filter> </Files> <Globals> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |