[dia] [warningectomy] comparison of unsigned enum expression < 0 is always false



commit db439178f650ec095acbed90e89d838310b2676f
Author: Hans Breuer <hans breuer org>
Date:   Fri Oct 3 23:32:51 2014 +0200

    [warningectomy] comparison of unsigned enum expression < 0 is always false
    
    cursor.c:76:37: warning: comparison of unsigned enum expression < 0 is always false 
[-Wtautological-compare]
      if (ctype >= MAX_CURSORS || ctype < 0) {
                                  ~~~~~ ^ ~

 app/cursor.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/app/cursor.c b/app/cursor.c
index 539cefb..54f0549 100644
--- a/app/cursor.c
+++ b/app/cursor.c
@@ -72,8 +72,9 @@ static GdkCursor *create_cursor(GdkWindow *window,
                                int hot_x, int hot_y);
 
 GdkCursor *
-get_cursor(DiaCursorType ctype) {
-  if (ctype >= MAX_CURSORS || ctype < 0) {
+get_cursor(DiaCursorType ctype)
+{
+  if (ctype >= G_N_ELEMENTS (cursors)) {
     return NULL;
   }
   if (cursors[ctype].cursor == NULL) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]