Преглед на файлове

HPCC-10646 Warning: case label value is less than minimum value for type

Change Thread class char (implicit used as TinyInt) type datamembers to int.
Change related functions parameter from char to int.

Signed-off-by: Attila Vamos <attila.vamos@gmail.com>
Attila Vamos преди 11 години
родител
ревизия
1e1053f10a
променени са 2 файла, в които са добавени 6 реда и са изтрити 6 реда
  1. 2 2
      system/jlib/jthread.cpp
  2. 4 4
      system/jlib/jthread.hpp

+ 2 - 2
system/jlib/jthread.cpp

@@ -150,7 +150,7 @@ void *Thread::_threadmain(void *v)
 }
 
 // JCSMORE - should have a setPriority(), unsupported under _WIN32
-void Thread::adjustPriority(char delta)
+void Thread::adjustPriority(int delta)
 {
     if (delta < -2)
         prioritydelta = -2;
@@ -229,7 +229,7 @@ bool Thread::isCurrentThread() const
 }
 
 // _nicelevel ranges from -20 to 19, the higher the nice level, the less cpu time the thread will get.
-void Thread::setNice(char _nicelevel)
+void Thread::setNice(int _nicelevel)
 {
     if (_nicelevel < -20 || _nicelevel > 19)
         throw MakeStringException(0, "nice level should be between -20 and 19");

+ 4 - 4
system/jlib/jthread.hpp

@@ -67,8 +67,8 @@ class jlib_decl Thread : public CInterface, public IThread
 private:
     ThreadId threadid;
     unsigned short stacksize; // in 4K blocks
-    char prioritydelta;
-    char nicelevel;
+    int prioritydelta;
+    int nicelevel;
 
     bool alive;
     unsigned tidlog;
@@ -103,9 +103,9 @@ public:
     Thread() { init(NULL); }
     ~Thread();
 
-    void adjustPriority(char delta);
+    void adjustPriority(int delta);
     bool isCurrentThread() const;
-    void setNice(char nicelevel);
+    void setNice(int nicelevel);
     void setStackSize(size32_t size);               // required stack size in bytes - called before start() (obviously)
     const char *getName() { const char *ret = ithreadname?ithreadname->get():NULL; return ret?ret:"unknown"; }
     bool isAlive() { return alive; }