Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added continuous Travis-CI, building with checking with both GCC and Clang #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: c
compiler:
- clang
- gcc
script:
- . build.sh
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/neonsoftware/tinyosc.svg?branch=ci)](https://travis-ci.org/neonsoftware/tinyosc)

# TinyOSC

TinyOSC is a minimal [Open Sound Control](http://opensoundcontrol.org/) (OSC) library written in C. The typical use case is to parse a raw buffer received directly from a socket. Given the limited nature of the library it also tends to be quite fast. It doesn't hold on to much state and it doesn't do much error checking. If you have a good idea of what OSC packets you will receive and need to process them quickly, this library might be for you.
Expand Down
5 changes: 3 additions & 2 deletions tinyosc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <inttypes.h>
#if _WIN32
#include <winsock2.h>
#define tosc_strncpy(_dst, _src, _len) strncpy_s(_dst, _len, _src, _TRUNCATE)
Expand Down Expand Up @@ -301,8 +302,8 @@ void tosc_printMessage(tosc_message *osc) {
case 'f': printf(" %g", tosc_getNextFloat(osc)); break;
case 'd': printf(" %g", tosc_getNextDouble(osc)); break;
case 'i': printf(" %d", tosc_getNextInt32(osc)); break;
case 'h': printf(" %lld", tosc_getNextInt64(osc)); break;
case 't': printf(" %lld", tosc_getNextTimetag(osc)); break;
case 'h': printf(" %" PRId64, tosc_getNextInt64(osc)); break; // PRId64 chooses corrent format (ld,lld,..)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of application do you have such that "old compilers" (which apparently don't support C99) are necessary?

Copy link
Author

@neonsoftware neonsoftware Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis CI, for example, it's a modern and recent system, although the default compiler installed there is clang 3.4 (latest clang version is ), which would not pass the compilation with -Werror.

Moreover, for the not supporting c99, PRId64 and #include <inttypes.h> are in c99, and the original problem is about warning with printing int64_t and uint64_t with an %lld, which the compiler might do with good intention, as being long long int its not always the case for those. more details
PRId64 and PRIi64 are c99 and will always place the right format, but please correct me if I'm wrong or let me know for any other use cases

case 't': printf(" %" PRIu64, tosc_getNextTimetag(osc)); break; // PRIu64 chooses corrent format (lu,llu,..)
case 's': printf(" %s", tosc_getNextString(osc)); break;
case 'F': printf(" false"); break;
case 'I': printf(" inf"); break;
Expand Down