]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge /fml/ag-raetsch/home/maan/scm/paraslash_meins/paraslash
authorAndre Noll <maan@systemlinux.org>
Mon, 11 Jun 2007 10:06:54 +0000 (12:06 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 11 Jun 2007 10:06:54 +0000 (12:06 +0200)
Makefile.in
NEWS
aac_afh.c
audioc.c
crypt.c
error.h
http_recv.c
ogg_afh.c
para.h
write_common.c

index 9a10859f65c4c04c63a889f6b039e38149437966..d44716e517961848022fc872d89ab02cf8254555 100644 (file)
@@ -20,10 +20,14 @@ DEBUG_CPPFLAGS += -Wredundant-decls
 # produces false positives
 # DEBUG_CPPFLAGS += -Wunreachable-code
 # DEBUG_CPPFLAGS += -Wwrite-strings
+
 # invalid option for gcc-3.3.3
 # DEBUG_CPPFLAGS += -Wextra
 # DEBUG_CPPFLAGS += -Wold-style-definition
 
+# many warnings about trivial stuff
+# CPPFLAGS += -Wconversion
+
 CPPFLAGS += -Os
 CPPFLAGS += -Wall
 CPPFLAGS += -Wuninitialized
diff --git a/NEWS b/NEWS
index 82db18b07108c95f4c1d4de6c2a7b1e276f8f36d..1ec92688f6ef7e6eb00d4835fccf5983e3726756 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,16 @@
 NEWS
 ====
 
----------------------------------------------
-0.?.? (to be announced) "isotropic threshold"
----------------------------------------------
+----------------------------------------------
+0.2.17 (to be announced) "isotropic threshold"
+----------------------------------------------
+
+Only bugfixes and cleanups in this version which marks the end of
+the 0.2.x series if no serious bugs show up after the release.
+
+       - be more carful wrt. signed vs. unsigned argument passing.
+       - cleanup error.h and fix some references to invalid error
+         codes.
 
 --------------------------------------
 0.2.16 (2007-04-05) "neural discharge"
index 26cffa3cd3b62f4f6e2138d1eb6b9e39e3a4f2c4..0a352c886164e858001fec0397da3aba7cab7cfb 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -117,7 +117,7 @@ static int aac_get_file_info(char *map, size_t numbytes,
        if (ret < 0)
                goto out;
        handle = aac_open();
-       ret = -E_AACDEC_INIT;
+       ret = -E_AAC_AFH_INIT;
        if (NeAACDecInit(handle, umap + skip, decoder_len, &rate, &channels))
                goto out;
        if (!channels)
index 551c34e63b80d86c05be4103a02c9209c5fd0051..7c6fd8c05e257c8c2f5a5ed1f2e97afbd8bacf81 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
        ret = -E_INIT_SOCK_ADDR;
        if (init_unix_addr(&unix_addr, socket_name) < 0)
                goto out;
-       ret = - E_AUDIOC_CONNECT;
+       ret = -E_AUDIOC_CONNECT;
        if (connect(fd, (struct sockaddr *)&unix_addr, UNIX_PATH_MAX) < 0)
                goto out;
        ret = send_cred_buffer(fd, args);
diff --git a/crypt.c b/crypt.c
index b3bac46697765c02132c7a18603f102516d360c7..ba2e7df0c4c8cd2b88200f198c5dff8ae0db1155 100644 (file)
--- a/crypt.c
+++ b/crypt.c
@@ -57,7 +57,8 @@ int get_rsa_key(char *key_file, RSA **rsa, int private)
        EVP_PKEY *key = load_key(key_file, private);
 
        if (!key)
-               return (private == LOAD_PRIVATE_KEY)? -E_PRIVATE_KEY : -E_PUBLIC_KEY;
+               return (private == LOAD_PRIVATE_KEY)? -E_PRIVATE_KEY
+                       : -E_PUBLIC_KEY;
        *rsa = EVP_PKEY_get1_RSA(key);
        EVP_PKEY_free(key);
        if (!*rsa)
diff --git a/error.h b/error.h
index 87985dc6f477ddec7f1abe9a52682dcf8d10f60a..318448666fb4ea30a7835858b205a60ba89936b5 100644 (file)
--- a/error.h
+++ b/error.h
@@ -102,7 +102,6 @@ extern const char **para_errlist[];
 #define OSX_WRITE_ERRORS \
        PARA_ERROR(STREAM_FORMAT, "could not set stream format"), \
        PARA_ERROR(ADD_CALLBACK, "can not add callback"), \
-       PARA_ERROR(READ_STDIN, "failed to read from stdin"), \
        PARA_ERROR(OPEN_COMP, "OpenAComponent() error"), \
        PARA_ERROR(UNIT_INIT, "AudioUnitInitialize() error"), \
        PARA_ERROR(UNIT_START, "AudioUnitStart() error"), \
@@ -119,7 +118,6 @@ extern const char **para_errlist[];
 
 
 
-
 #define CLIENT_COMMON_ERRORS \
        PARA_ERROR(CLIENT_SYNTAX, "syntax error"), \
        PARA_ERROR(INVALID_CHALLENGE, "did not receive valid challenge"), \
@@ -174,27 +172,22 @@ extern const char **para_errlist[];
 
 
 #define HTTP_RECV_ERRORS \
-       PARA_ERROR(SEND_HTTP_REQUEST, "failed to send http request"), \
-       PARA_ERROR(MISSING_OK, "did not receive OK message from peer"), \
-       PARA_ERROR(HTTP_RECV_BUF, "did not receive buffer"), \
        PARA_ERROR(HTTP_RECV_EOF, "http_recv: end of file"), \
+       PARA_ERROR(HTTP_RECV_OVERRUN, "http_recv: outout buffer overrun"), \
 
 
 #define RECV_ERRORS \
-       PARA_ERROR(RECV_SELECT, "recv select error"), \
-       PARA_ERROR(WRITE_STDOUT, "stdout write error"), \
+       PARA_ERROR(RECV_SYNTAX, "recv syntax error"), \
 
 
 #define RECV_COMMON_ERRORS \
-       PARA_ERROR(RECV_SYNTAX, "recv syntax error"), \
 
 
 #define AUDIOD_ERRORS \
-       PARA_ERROR(WRITE_AUDIO_DATA, "failed to write audio data"), \
        PARA_ERROR(NO_MORE_SLOTS, "no more empty slots"), \
        PARA_ERROR(MISSING_COLON, "syntax error: missing colon"), \
        PARA_ERROR(UNSUPPORTED_AUDIO_FORMAT, "given audio format not supported"), \
-       PARA_ERROR(STATUS_EOF, "server closed status connection"), \
+       PARA_ERROR(SIGNAL_CAUGHT, "caught signal"), \
 
 
 #define AUDIOD_COMMAND_ERRORS \
@@ -249,7 +242,6 @@ extern const char **para_errlist[];
        PARA_ERROR(SIGNAL_READ, "read error from signal pipe"), \
        PARA_ERROR(WAITPID, "waitpid error"), \
        PARA_ERROR(SIGNAL_PIPE, "failed to setup signal pipe"), \
-       PARA_ERROR(SIGNAL_CAUGHT, "caught signal"), \
 
 
 #define STRING_ERRORS \
@@ -265,9 +257,7 @@ extern const char **para_errlist[];
 #define MP3_AFH_ERRORS \
        PARA_ERROR(FRAME, "invalid mp3 frame"), \
        PARA_ERROR(FRAME_LENGTH, "invalid frame length"), \
-       PARA_ERROR(MP3_NO_FILE, "invalid mp3 file pointer"), \
        PARA_ERROR(MP3_INFO, "could not read mp3 info"), \
-       PARA_ERROR(MP3_REPOS, "mp3 repositioning error"), \
        PARA_ERROR(HEADER_FREQ, "invalid header frequency"), \
        PARA_ERROR(HEADER_BITRATE, "invalid header bitrate"), \
 
@@ -275,6 +265,7 @@ extern const char **para_errlist[];
 #define AAC_AFH_ERRORS \
        PARA_ERROR(STSZ, "did not find stcz atom"), \
        PARA_ERROR(MP4ASC, "audio spec config error"), \
+       PARA_ERROR(AAC_AFH_INIT, "failed to init aac decoder"), \
 
 
 #define AAC_COMMON_ERRORS \
@@ -288,16 +279,14 @@ extern const char **para_errlist[];
        PARA_ERROR(STREAM_PAGEIN, "ogg stream page-in error (first page)"), \
        PARA_ERROR(STREAM_PACKETOUT, "ogg stream packet-out error (first packet)"), \
        PARA_ERROR(VORBIS, "vorbis synthesis header-in error (not vorbis?)"), \
-       PARA_ERROR(OGG_NO_FILE, "invalid ogg file pointer"), \
-       PARA_ERROR(OGG_OPEN, "ov_open error"), \
        PARA_ERROR(OGG_INFO, "ov_info error"), \
-       PARA_ERROR(OGG_REPOS, "ogg repositioning error"), \
+       PARA_ERROR(OGG_VERSION, "unsupported ogg version"), \
+       PARA_ERROR(OGG_BAD_HEADER, "invalid ogg vorbis header"), \
+       PARA_ERROR(OGG_UNKNOWN_ERROR, "unknown ogg vorbis error"), \
 
 
 #define VSS_ERRORS \
        PARA_ERROR(AUDIO_FORMAT, "audio format not recognized"), \
-       PARA_ERROR(FSTAT, "failed to fstat() audio file"), \
-       PARA_ERROR(EMPTY_CHUNK, "empty chunk"), \
 
 
 #define AFS_ERRORS \
@@ -376,13 +365,13 @@ extern const char **para_errlist[];
 
 #define DCCP_ERRORS \
        PARA_ERROR(DCCP_SOCKET, "can not create dccp socket"), \
-       PARA_ERROR(DCCP_RECV_EOF, "dccp_recv: end of file"), \
 
 
 #define DCCP_RECV_ERRORS \
        PARA_ERROR(ADDR_INFO, "getaddrinfo error"), \
        PARA_ERROR(DCCP_OVERRUN, "dccp output buffer buffer overrun"), \
        PARA_ERROR(DCCP_CONNECT, "dccp connect error"), \
+       PARA_ERROR(DCCP_RECV_EOF, "dccp_recv: end of file"), \
 
 
 #define DCCP_SEND_ERRORS \
@@ -395,8 +384,6 @@ extern const char **para_errlist[];
        PARA_ERROR(F_GETFL, "failed to get fd flags"), \
        PARA_ERROR(F_SETFL, "failed to set fd flags"), \
        PARA_ERROR(FGETS, "fgets error"), \
-       PARA_ERROR(FSEEK, "fseek error"), \
-       PARA_ERROR(FREAD, "fread error"), \
 
 
 #define WRITE_ERRORS \
index 8b550391294724741a86c0272f37fa1d2add7c1c..a36038ad23ddad69a7139891ff07404e05671182 100644 (file)
@@ -139,7 +139,7 @@ static void http_recv_post_select(struct sched *s, struct task *t)
                phd->status = HTTP_STREAMING;
                goto out;
        }
-       t->ret = -E_OVERRUN;
+       t->ret = -E_HTTP_RECV_OVERRUN;
        if (rn->loaded >= BUFSIZE)
                goto out;
        t->ret = recv_bin_buffer(phd->fd, rn->buf + rn->loaded,
index d5c4726269b4d30c889f16340cb5f2ca5e86c640..94383c4564156cb7f608c9eaa9a7b6b5e8846614 100644 (file)
--- a/ogg_afh.c
+++ b/ogg_afh.c
 #define CHUNK_SIZE 32768
 static double chunk_time = 0.25;
 
+/** describes a memory-mapped ogg vorbis file */
 struct ogg_datasource {
+       /** the memory mapping */
        char *map;
+       /** this size of the mapping */
        off_t numbytes;
+       /** the current position in the mapping */
        off_t fpos;
 };
 
@@ -102,17 +106,16 @@ static int ogg_open_callbacks(void *datasource, OggVorbis_File *vf, ov_callbacks
                0, /* no initial bytes */
                c); /* the ov_open_callbacks */
 
-       /* FIXME: provide better error codes */
        if (ret == OV_EREAD)
                return -E_OGG_READ;
        if (ret == OV_ENOTVORBIS)
-               return -E_OGG_READ;
+               return -E_VORBIS;
        if (ret == OV_EVERSION)
-               return -E_OGG_READ;
+               return -E_OGG_VERSION;
        if (ret == OV_EBADHEADER)
-               return -E_OGG_READ;
+               return -E_OGG_BAD_HEADER;
        if (ret < 0)
-               return -E_OGG_READ;
+               return -E_OGG_UNKNOWN_ERROR;
        return 1;
 
 }
@@ -147,7 +150,7 @@ static int ogg_compute_header_len(char *map, size_t numbytes,
        ogg_stream_init(stream_out, serial);
        ret = ogg_stream_pagein(stream_in, &page);
        if (ret < 0) {
-               ret = E_STREAM_PAGEIN;
+               ret = -E_STREAM_PAGEIN;
                goto err2;
        }
        ret = ogg_stream_packetout(stream_in, &packet);
diff --git a/para.h b/para.h
index ed2c0bccae649368e1530680dac6e90373127674..c84685d9940ffafa3213be1bd64c672d119fca8e 100644 (file)
--- a/para.h
+++ b/para.h
 #define COMPILE_TIME_LOGLEVEL 0
 
 #if DEBUG > COMPILE_TIME_LOGLEVEL
-#define PARA_DEBUG_LOG(f,...) para_log(DEBUG, "%s: " f, __FUNCTION__, __VA_ARGS__)
+#define PARA_DEBUG_LOG(f,...) para_log(DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_DEBUG_LOG(...) do {;} while (0)
 #endif
 
 #if INFO > COMPILE_TIME_LOGLEVEL
-#define PARA_INFO_LOG(f,...) para_log(INFO, "%s: " f, __FUNCTION__, __VA_ARGS__)
+#define PARA_INFO_LOG(f,...) para_log(INFO, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_INFO_LOG(...) do {;} while (0)
 #endif
 
 #if NOTICE > COMPILE_TIME_LOGLEVEL
-#define PARA_NOTICE_LOG(f,...) para_log(NOTICE, "%s: " f, __FUNCTION__, __VA_ARGS__)
+#define PARA_NOTICE_LOG(f,...) para_log(NOTICE, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_NOTICE_LOG(...) do {;} while (0)
 #endif
 
 #if WARNING > COMPILE_TIME_LOGLEVEL
-#define PARA_WARNING_LOG(f,...) para_log(WARNING, "%s: " f, __FUNCTION__, __VA_ARGS__)
+#define PARA_WARNING_LOG(f,...) para_log(WARNING, "%s: " f, __FUNCTION__, ##  __VA_ARGS__)
 #else
 #define PARA_WARNING_LOG(...) do {;} while (0)
 #endif
 
 #if ERROR > COMPILE_TIME_LOGLEVEL
-#define PARA_ERROR_LOG(f,...) para_log(ERROR, "%s: " f, __FUNCTION__, __VA_ARGS__)
+#define PARA_ERROR_LOG(f,...) para_log(ERROR, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_ERROR_LOG(...) do {;} while (0)
 #endif
 
 #if CRIT > COMPILE_TIME_LOGLEVEL
-#define PARA_CRIT_LOG(f,...) para_log(CRIT, "%s: " f, __FUNCTION__, __VA_ARGS__)
+#define PARA_CRIT_LOG(f,...) para_log(CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_CRIT_LOG(...) do {;} while (0)
 #endif
 
 #if EMERG > COMPILE_TIME_LOGLEVEL
-#define PARA_EMERG_LOG(f,...) para_log(EMERG, "%s: " f, __FUNCTION__, __VA_ARGS__)
+#define PARA_EMERG_LOG(f,...) para_log(EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_EMERG_LOG(...)
 #endif
index 78d1523e2c14cd95afb00fab6a58aa50a49a908e..f1c1e8f131f3500a326f8832c1d332c9d17cbbac 100644 (file)
@@ -111,6 +111,7 @@ int wng_open(struct writer_node_group *g)
        g->eof = 0;
        return 1;
 err_out:
+       PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));
        unregister_task(&g->task);
        while (i > 0) {
                struct writer_node *wn = &g->writer_nodes[--i];