summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3371347)
It contained quite some unused error codes. This patch gets rid of
them and thus saves some space in the resulting binaries.
More importantly, there were two instances where a source file used
an error value of another source file (which is ok), but the object
file of that other source file would not get linked into the resulting
binary (which is not ok):
- aac_afh.c used E_AACDEC_INIT, which is not contained in
para_server
- http_recv.c used E_OVERRUN which is defined only if ortp
support was compiled in.
The patch also fixes another bug in the ogg vorbis audio format handler
where (the positive value) E_STREAM_PAGEIN was returned instead of
-E_STREAM_PAGEIN in case ogg_stream_pagein() failed.
# produces false positives
# DEBUG_CPPFLAGS += -Wunreachable-code
# DEBUG_CPPFLAGS += -Wwrite-strings
# 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
# 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
CPPFLAGS += -Os
CPPFLAGS += -Wall
CPPFLAGS += -Wuninitialized
if (ret < 0)
goto out;
handle = aac_open();
if (ret < 0)
goto out;
handle = aac_open();
if (NeAACDecInit(handle, umap + skip, decoder_len, &rate, &channels))
goto out;
if (!channels)
if (NeAACDecInit(handle, umap + skip, decoder_len, &rate, &channels))
goto out;
if (!channels)
ret = -E_INIT_SOCK_ADDR;
if (init_unix_addr(&unix_addr, socket_name) < 0)
goto out;
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);
if (connect(fd, (struct sockaddr *)&unix_addr, UNIX_PATH_MAX) < 0)
goto out;
ret = send_cred_buffer(fd, args);
EVP_PKEY *key = load_key(key_file, private);
if (!key)
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)
*rsa = EVP_PKEY_get1_RSA(key);
EVP_PKEY_free(key);
if (!*rsa)
#define OSX_WRITE_ERRORS \
PARA_ERROR(STREAM_FORMAT, "could not set stream format"), \
PARA_ERROR(ADD_CALLBACK, "can not add callback"), \
#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"), \
PARA_ERROR(OPEN_COMP, "OpenAComponent() error"), \
PARA_ERROR(UNIT_INIT, "AudioUnitInitialize() error"), \
PARA_ERROR(UNIT_START, "AudioUnitStart() error"), \
#define CLIENT_COMMON_ERRORS \
PARA_ERROR(CLIENT_SYNTAX, "syntax error"), \
PARA_ERROR(INVALID_CHALLENGE, "did not receive valid challenge"), \
#define CLIENT_COMMON_ERRORS \
PARA_ERROR(CLIENT_SYNTAX, "syntax error"), \
PARA_ERROR(INVALID_CHALLENGE, "did not receive valid challenge"), \
#define HTTP_RECV_ERRORS \
#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_EOF, "http_recv: end of file"), \
+ PARA_ERROR(HTTP_RECV_OVERRUN, "http_recv: outout buffer overrun"), \
- 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 \
#define RECV_COMMON_ERRORS \
- PARA_ERROR(RECV_SYNTAX, "recv syntax error"), \
- 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(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 \
#define AUDIOD_COMMAND_ERRORS \
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_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 MP3_AFH_ERRORS \
PARA_ERROR(FRAME, "invalid mp3 frame"), \
PARA_ERROR(FRAME_LENGTH, "invalid frame length"), \
#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_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"), \
PARA_ERROR(HEADER_FREQ, "invalid header frequency"), \
PARA_ERROR(HEADER_BITRATE, "invalid header bitrate"), \
#define AAC_AFH_ERRORS \
PARA_ERROR(STSZ, "did not find stcz atom"), \
PARA_ERROR(MP4ASC, "audio spec config error"), \
#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 \
#define AAC_COMMON_ERRORS \
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(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_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"), \
#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 DCCP_ERRORS \
PARA_ERROR(DCCP_SOCKET, "can not create dccp socket"), \
#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"), \
#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 \
#define DCCP_SEND_ERRORS \
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(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"), \
phd->status = HTTP_STREAMING;
goto out;
}
phd->status = HTTP_STREAMING;
goto out;
}
+ t->ret = -E_HTTP_RECV_OVERRUN;
if (rn->loaded >= BUFSIZE)
goto out;
t->ret = recv_bin_buffer(phd->fd, rn->buf + rn->loaded,
if (rn->loaded >= BUFSIZE)
goto out;
t->ret = recv_bin_buffer(phd->fd, rn->buf + rn->loaded,
0, /* no initial bytes */
c); /* the ov_open_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)
if (ret == OV_EREAD)
return -E_OGG_READ;
if (ret == OV_ENOTVORBIS)
if (ret == OV_EBADHEADER)
if (ret == OV_EBADHEADER)
+ return -E_OGG_BAD_HEADER;
+ return -E_OGG_UNKNOWN_ERROR;
ogg_stream_init(stream_out, serial);
ret = ogg_stream_pagein(stream_in, &page);
if (ret < 0) {
ogg_stream_init(stream_out, serial);
ret = ogg_stream_pagein(stream_in, &page);
if (ret < 0) {
+ ret = -E_STREAM_PAGEIN;
goto err2;
}
ret = ogg_stream_packetout(stream_in, &packet);
goto err2;
}
ret = ogg_stream_packetout(stream_in, &packet);
g->eof = 0;
return 1;
err_out:
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];
unregister_task(&g->task);
while (i > 0) {
struct writer_node *wn = &g->writer_nodes[--i];