Browse Source

NamedPipe.cpp: fix unix build

1vanK 3 years ago
parent
commit
424923f2e2
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Source/Urho3D/IO/NamedPipe.cpp

+ 4 - 2
Source/Urho3D/IO/NamedPipe.cpp

@@ -274,8 +274,10 @@ unsigned NamedPipe::Read(void* dest, unsigned size)
         return 0;
         return 0;
 }
 }
 
 
-unsigned NamedPipe::Write(const void* data, unsigned size)
+i32 NamedPipe::Write(const void* data, i32 size)
 {
 {
+    assert(size >= 0);
+
     // Attempt to open late if only the read handle is open yet
     // Attempt to open late if only the read handle is open yet
     if (writeHandle_ == -1 && readHandle_ != -1)
     if (writeHandle_ == -1 && readHandle_ != -1)
     {
     {
@@ -297,7 +299,7 @@ unsigned NamedPipe::Write(const void* data, unsigned size)
             written += writtenNow;
             written += writtenNow;
         }
         }
 
 
-        return (unsigned)written;
+        return written;
     }
     }
     else
     else
         return 0;
         return 0;