]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - error.h
Merge topic branch t/sf_float into pu
[paraslash.git] / error.h
diff --git a/error.h b/error.h
index 94f315ce9948c2a042c3014c5b5c334af1129da8..971d3e7f9b7df5a1c96744cc003f93343cd0d6c9 100644 (file)
--- a/error.h
+++ b/error.h
        PARA_ERROR(OGG_PACKET_IN, "ogg_stream_packetin() failed"), \
        PARA_ERROR(OGG_SYNC, "internal ogg storage overflow"), \
        PARA_ERROR(OPENSSH_PARSE, "could not parse openssh private key"), \
+       PARA_ERROR(OPENSSL, "openssl error"), \
        PARA_ERROR(OPUS_COMMENT, "invalid or corrupted opus comment"), \
        PARA_ERROR(OPUS_DECODE, "opus decode error"), \
        PARA_ERROR(OPUS_HEADER, "invalid opus header"), \
        PARA_ERROR(PATH_FOUND, ""), /* not really an error */ \
        PARA_ERROR(PLAYLIST_EMPTY, "attempted to load empty playlist"), \
        PARA_ERROR(PREBUFFER_SUCCESS, "prebuffering complete"), \
-       PARA_ERROR(PRIVATE_KEY, "can not read private key"), \
        PARA_ERROR(QUEUE, "packet queue overrun"), \
        PARA_ERROR(READ_PATTERN, "did not read expected pattern"), \
        PARA_ERROR(RECVMSG, "recvmsg() failed"), \
@@ -290,18 +290,20 @@ static const char *weak_lls_strerror(int) __attribute__ ((weakref("lls_strerror"
  */
 _static_inline_ const char *para_strerror(int num)
 {
+       unsigned idx = num & ~((1U << OSL_ERROR_BIT) | (1U << LLS_ERROR_BIT)
+               | (1U << SYSTEM_ERROR_BIT));
        assert(num > 0);
        if (IS_OSL_ERROR(num)) {
                assert(weak_osl_strerror);
-               return weak_osl_strerror(num & ~(1U << OSL_ERROR_BIT));
+               return weak_osl_strerror(idx);
        }
        if (IS_LLS_ERROR(num)) {
                assert(weak_lls_strerror);
-               return weak_lls_strerror(num & ~(1U << LLS_ERROR_BIT));
+               return weak_lls_strerror(idx);
        }
        if (IS_SYSTEM_ERROR(num))
-               return strerror(num & ~(1U << SYSTEM_ERROR_BIT));
-       return para_errlist[num];
+               return strerror(idx);
+       return para_errlist[idx];
 }
 
 /**