Type-cast all E_* error codes to int 27/138827/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 14 Jul 2017 02:57:09 +0000 (11:57 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 14 Jul 2017 02:57:09 +0000 (11:57 +0900)
This allows to remove explicit casting of E_* codes when throwing & catching them as int.

Change-Id: Ic8b566a7f5ff9013b15cb957c3a01f78a7c90e77
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
include/ContextTypes.h

index 13150f2..a4bf832 100644 (file)
 #define CTX_SIGNAL_NEW_CLIENT  "NewClient"
 
 /* Error Shortcuts */
-#define E_NONE         TIZEN_ERROR_NONE                                /* Successful */
-#define E_PARAM                TIZEN_ERROR_INVALID_PARAMETER   /* Invalid function parameter */
-#define E_INV_OP       TIZEN_ERROR_INVALID_OPERATION   /* Function not implemented */
-#define E_NO_MEM       TIZEN_ERROR_OUT_OF_MEMORY               /* Memory allocation failed */
-#define E_ACCESS       TIZEN_ERROR_PERMISSION_DENIED   /* Permission denied */
-#define E_SUPPORT      TIZEN_ERROR_NOT_SUPPORTED               /* Feature not supported */
-#define E_NO_DATA      TIZEN_ERROR_NO_DATA                             /* No data available */
-#define E_UNKNOWN      TIZEN_ERROR_UNKNOWN                             /* Unknown error */
-
-#define E_STARTED              (TIZEN_ERROR_CONTEXT | 0x01)    /* Feature already activated */
-#define E_NOT_STARTED  (TIZEN_ERROR_CONTEXT | 0x02)    /* Feature already deactivated */
-#define E_RANGE                        (TIZEN_ERROR_CONTEXT | 0x03)    /* Index out of range */
-#define E_FAILED               (TIZEN_ERROR_CONTEXT | 0x04)    /* Operation failed with some internal errors */
-#define E_RULE_ON              (TIZEN_ERROR_CONTEXT | 0x05)    /* Rule enabled */
-#define E_RULE_OFF             (TIZEN_ERROR_CONTEXT | 0x06)    /* Rule not enabled */
-#define E_INV_RULE             (TIZEN_ERROR_CONTEXT | 0x07)    /* Invalid rule */
-#define E_NO_RULE              (TIZEN_ERROR_CONTEXT | 0x08)    /* Rule not exists */
-#define E_DATA_EXIST   (TIZEN_ERROR_CONTEXT | 0X09)    /* Data exists */
-#define E_INV_DATA             (TIZEN_ERROR_CONTEXT | 0X0A)    /* Invalid data */
+#define E_NONE         (int)TIZEN_ERROR_NONE                           /* Successful */
+#define E_PARAM                (int)TIZEN_ERROR_INVALID_PARAMETER      /* Invalid function parameter */
+#define E_INV_OP       (int)TIZEN_ERROR_INVALID_OPERATION      /* Function not implemented */
+#define E_NO_MEM       (int)TIZEN_ERROR_OUT_OF_MEMORY          /* Memory allocation failed */
+#define E_ACCESS       (int)TIZEN_ERROR_PERMISSION_DENIED      /* Permission denied */
+#define E_SUPPORT      (int)TIZEN_ERROR_NOT_SUPPORTED          /* Feature not supported */
+#define E_NO_DATA      (int)TIZEN_ERROR_NO_DATA                        /* No data available */
+#define E_UNKNOWN      (int)TIZEN_ERROR_UNKNOWN                        /* Unknown error */
+
+#define E_STARTED              (int)(TIZEN_ERROR_CONTEXT | 0x01)       /* Feature already activated */
+#define E_NOT_STARTED  (int)(TIZEN_ERROR_CONTEXT | 0x02)       /* Feature already deactivated */
+#define E_RANGE                        (int)(TIZEN_ERROR_CONTEXT | 0x03)       /* Index out of range */
+#define E_FAILED               (int)(TIZEN_ERROR_CONTEXT | 0x04)       /* Operation failed with some internal errors */
+#define E_RULE_ON              (int)(TIZEN_ERROR_CONTEXT | 0x05)       /* Rule enabled */
+#define E_RULE_OFF             (int)(TIZEN_ERROR_CONTEXT | 0x06)       /* Rule not enabled */
+#define E_INV_RULE             (int)(TIZEN_ERROR_CONTEXT | 0x07)       /* Invalid rule */
+#define E_NO_RULE              (int)(TIZEN_ERROR_CONTEXT | 0x08)       /* Rule not exists */
+#define E_DATA_EXIST   (int)(TIZEN_ERROR_CONTEXT | 0X09)       /* Data exists */
+#define E_INV_DATA             (int)(TIZEN_ERROR_CONTEXT | 0X0A)       /* Invalid data */
 
 /* Logging and Error Handling */
 #define _I SLOGI