]> git.draconx.ca Git - liblbx.git/blobdiff - src/error.c
Trivial manual fixes.
[liblbx.git] / src / error.c
index e46c28faf1b5bb696c4caeed86c169f54f7bb5ec..fb74bd50ad24c93d1bd6c9e4eb4bf5c8e4ea6024 100644 (file)
 #include <assert.h>
 #include <limits.h>
 #include <inttypes.h>
-#include <libintl.h>
 
 #include "error.h"
+#include "misc.h"
 
-#define _(s) dgettext(PACKAGE, s)
+// #define _(s) dgettext(PACKAGE, s)
+#define _(s) (s)
 
 #if !defined(LBX_ERROR_LIMIT)
 #      define LBX_ERROR_LIMIT 256
@@ -40,8 +41,6 @@ static int error_ring[LBX_ERROR_LIMIT];
 static const char **user_errors;
 static int user_error_count, user_error_max = 2;
 
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
 int lbx_error_new(const char *str)
 {
        assert(user_error_count >= 0 && user_error_count <= user_error_max);
@@ -50,9 +49,9 @@ int lbx_error_new(const char *str)
                const char **new;
                size_t size;
 
-               if (user_error_max >= MIN(SIZE_MAX, INT_MAX)/2 - LBX_EUBASE)
+               if (user_error_max >= MIN((size_t)-1, INT_MAX)/2 - LBX_EUBASE)
                        return -1;
-               if (2 * user_error_max >= SIZE_MAX / sizeof *user_errors)
+               if (2 * user_error_max >= (size_t)-1 / sizeof *user_errors)
                        return -1;
 
                size = 2 * user_error_max * sizeof *user_errors;