diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-09-08 14:15:28 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-09-08 14:15:28 +0200 |
commit | faf7004c13f45442a6cdbe68ba977523d6593fc7 (patch) | |
tree | ac89711aa837fefbd02b157cb5f18685acd25b15 | |
parent | 83ba73a034583165d03873e8c3098397fc9ae5e8 (diff) | |
download | pianobar-faf7004c13f45442a6cdbe68ba977523d6593fc7.tar.gz pianobar-faf7004c13f45442a6cdbe68ba977523d6593fc7.tar.bz2 pianobar-faf7004c13f45442a6cdbe68ba977523d6593fc7.zip |
C99 conformance
-rw-r--r-- | libezxml/src/ezxml.c | 2 | ||||
-rw-r--r-- | libpiano/src/main.c | 2 | ||||
-rw-r--r-- | libpiano/src/xml.c | 2 | ||||
-rw-r--r-- | libwaitress/src/main.c | 3 | ||||
-rw-r--r-- | libwaitress/src/waitress.h | 4 | ||||
-rw-r--r-- | libwardrobe/src/main.c | 2 | ||||
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/settings.c | 2 | ||||
-rw-r--r-- | src/terminal.c | 7 | ||||
-rw-r--r-- | src/terminal.h | 4 | ||||
-rw-r--r-- | src/ui.c | 4 | ||||
-rw-r--r-- | src/ui.h | 8 | ||||
-rw-r--r-- | src/ui_readline.c | 2 | ||||
-rw-r--r-- | src/ui_readline.h | 2 |
14 files changed, 34 insertions, 13 deletions
diff --git a/libezxml/src/ezxml.c b/libezxml/src/ezxml.c index 4ba607a..52deb95 100644 --- a/libezxml/src/ezxml.c +++ b/libezxml/src/ezxml.c @@ -22,6 +22,8 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _BSD_SOURCE /* required by strdup() */ + #include <stdlib.h> #include <stdio.h> #include <stdarg.h> diff --git a/libpiano/src/main.c b/libpiano/src/main.c index f5e9b85..0510830 100644 --- a/libpiano/src/main.c +++ b/libpiano/src/main.c @@ -21,6 +21,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _BSD_SOURCE /* required by strdup() */ + #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c index 5045440..8e8fb2a 100644 --- a/libpiano/src/xml.c +++ b/libpiano/src/xml.c @@ -21,6 +21,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _BSD_SOURCE /* required by strdup() */ + #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/libwaitress/src/main.c b/libwaitress/src/main.c index cc06ec6..545aa0a 100644 --- a/libwaitress/src/main.c +++ b/libwaitress/src/main.c @@ -21,6 +21,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _POSIX_C_SOURCE 1 /* required by getaddrinfo() */ +#define _BSD_SOURCE /* snprintf() */ + #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> diff --git a/libwaitress/src/waitress.h b/libwaitress/src/waitress.h index d8c379d..0dab545 100644 --- a/libwaitress/src/waitress.h +++ b/libwaitress/src/waitress.h @@ -64,8 +64,8 @@ void WaitressSetProxy (WaitressHandle_t *, const char *, const char *); char *WaitressUrlEncode (const char *); char WaitressSplitUrl (const char *, char *, size_t, char *, size_t, char *, size_t); -inline char WaitressSetUrl (WaitressHandle_t *, const char *); -inline void WaitressSetHPP (WaitressHandle_t *, const char *, const char *, +char WaitressSetUrl (WaitressHandle_t *, const char *); +void WaitressSetHPP (WaitressHandle_t *, const char *, const char *, const char *); WaitressReturn_t WaitressFetchBuf (WaitressHandle_t *, char **); WaitressReturn_t WaitressFetchCall (WaitressHandle_t *); diff --git a/libwardrobe/src/main.c b/libwardrobe/src/main.c index e13c09d..d822aa5 100644 --- a/libwardrobe/src/main.c +++ b/libwardrobe/src/main.c @@ -53,7 +53,7 @@ inline void WardrobeInit (WardrobeHandle_t *wh) { * @param pointer * @param size or 0 to disable zeroing */ -inline void WardrobeFree (void *ptr, size_t size) { +void WardrobeFree (void *ptr, size_t size) { if (ptr != NULL) { if (size > 0) { memset (ptr, 0, size); @@ -21,6 +21,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _POSIX_C_SOURCE 1 /* fileno() */ +#define _BSD_SOURCE /* strdup() */ + /* system includes */ #include <stdlib.h> #include <string.h> diff --git a/src/settings.c b/src/settings.c index 341510f..a7d6f61 100644 --- a/src/settings.c +++ b/src/settings.c @@ -23,6 +23,8 @@ THE SOFTWARE. /* application settings */ +#define _BSD_SOURCE /* strdup() */ + #include <string.h> #include <stdlib.h> #include <stdio.h> diff --git a/src/terminal.c b/src/terminal.c index ab96004..2875638 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -21,6 +21,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _POSIX_C_SOURCE 1 /* fileno() */ +#define _BSD_SOURCE /* setlinebuf() */ + #include <termios.h> #include <stdio.h> @@ -60,14 +63,14 @@ void BarTermSetBuffer (char enable) { /* Save old terminal settings * @param save settings here */ -inline void BarTermSave (struct termios *termOrig) { +void BarTermSave (struct termios *termOrig) { tcgetattr (fileno (stdin), termOrig); } /* Restore terminal settings * @param Old settings */ -inline void BarTermRestore (struct termios *termOrig) { +void BarTermRestore (struct termios *termOrig) { tcsetattr (fileno (stdin), TCSANOW, termOrig); } diff --git a/src/terminal.h b/src/terminal.h index 13e9d57..e7aded9 100644 --- a/src/terminal.h +++ b/src/terminal.h @@ -26,7 +26,7 @@ THE SOFTWARE. void BarTermSetEcho (char); void BarTermSetBuffer (char); -inline void BarTermSave (struct termios *); -inline void BarTermRestore (struct termios *termOrig); +void BarTermSave (struct termios *); +void BarTermRestore (struct termios *termOrig); #endif /* _TERMINAL_H */ @@ -23,12 +23,16 @@ THE SOFTWARE. /* everything that interacts with the user */ +#define _POSIX_C_SOURCE 1 /* fileno() */ +#define _BSD_SOURCE /* strdup() */ + #include <stdio.h> #include <stdarg.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <errno.h> +#include <strings.h> /* waitpid () */ #include <sys/types.h> @@ -31,16 +31,16 @@ THE SOFTWARE. typedef enum {MSG_NONE, MSG_INFO, MSG_PLAYING, MSG_TIME, MSG_ERR, MSG_QUESTION, MSG_LIST} uiMsg_t; -inline void BarUiMsg (uiMsg_t type, const char *format, ...); -inline PianoReturn_t BarUiPrintPianoStatus (PianoReturn_t ret); +void BarUiMsg (uiMsg_t type, const char *format, ...); +PianoReturn_t BarUiPrintPianoStatus (PianoReturn_t ret); PianoStation_t *BarUiSelectStation (PianoHandle_t *ph, const char *prompt, FILE *curFd); PianoSong_t *BarUiSelectSong (PianoSong_t *startSong, FILE *curFd); PianoArtist_t *BarUiSelectArtist (PianoArtist_t *startArtist, FILE *curFd); char *BarUiSelectMusicId (PianoHandle_t *ph, FILE *curFd, char *); void BarStationFromGenre (PianoHandle_t *ph, FILE *curFd); -inline void BarUiPrintStation (PianoStation_t *); -inline void BarUiPrintSong (PianoSong_t *, PianoStation_t *); +void BarUiPrintStation (PianoStation_t *); +void BarUiPrintSong (PianoSong_t *, PianoStation_t *); void BarUiStartEventCmd (const BarSettings_t *settings, const char *type, const PianoStation_t *curStation, const PianoSong_t *curSong, PianoReturn_t); diff --git a/src/ui_readline.c b/src/ui_readline.c index 6b92ca6..b368a56 100644 --- a/src/ui_readline.c +++ b/src/ui_readline.c @@ -167,7 +167,7 @@ size_t BarReadline (char *buf, size_t bufSize, const char *mask, * @param buffer size * @return number of bytes read from stdin */ -inline size_t BarReadlineStr (char *buf, size_t bufSize, char noEcho, +size_t BarReadlineStr (char *buf, size_t bufSize, char noEcho, FILE *fd) { return BarReadline (buf, bufSize, NULL, 0, noEcho, fd); } diff --git a/src/ui_readline.h b/src/ui_readline.h index 194668a..f9620b6 100644 --- a/src/ui_readline.h +++ b/src/ui_readline.h @@ -22,7 +22,7 @@ THE SOFTWARE. */ size_t BarReadline (char *, size_t, const char *, char, char, FILE *); -inline size_t BarReadlineStr (char *, size_t, char, FILE *); +size_t BarReadlineStr (char *, size_t, char, FILE *); size_t BarReadlineInt (int *, FILE *); int BarReadlineYesNo (char def, FILE *); |