libo's People
libo's Issues
Add constants to o.expr
phi
(golden ratio)twelfth_root_two
thirteenth_root_three
comma missing error
9/10 times the problem with an expression is a missing comma -- it would be really really really useful to have an error message that tells you where the missing comma should be.
linux doesn't want to build
ilya@ubuntu:~/code/libo$ make linux
clang -std=c99 -fPIC -DLINUX_VERSION -D_XOPEN_SOURCE=500 -c -o osc_timetag.o osc_timetag.c
osc_timetag.c:572:18: error: variable has incomplete type 'struct timezone'
struct timezone tz;
^
osc_timetag.c:572:9: note: forward declaration of 'struct timezone'
struct timezone tz;
^
osc_timetag.c:588:18: error: variable has incomplete type 'struct timezone'
struct timezone tz;
^
osc_timetag.c:588:9: note: forward declaration of 'struct timezone'
struct timezone tz;
^
osc_timetag.c:605:18: error: variable has incomplete type 'struct timezone'
struct timezone tz;
^
osc_timetag.c:605:9: note: forward declaration of 'struct timezone'
struct timezone tz;
^
3 errors generated.
Makefile:101: recipe for target 'osc_timetag.o' failed
make: *** [osc_timetag.o] Error 1
I'm on libo-linux
and flex and bison appear to be working correctly:
ilya@ubuntu:~/code/libo$ git status
On branch libo-linux
Your branch is up-to-date with 'origin/libo-linux'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
osc_expr_parser.c
osc_expr_parser.h
osc_expr_parser.output
osc_expr_scanner.c
osc_expr_scanner.h
osc_legacy_parser.c
osc_legacy_parser.h
osc_legacy_parser.output
osc_legacy_scanner.c
osc_legacy_scanner.h
osc_parser.c
osc_parser.h
osc_parser.output
osc_scanner.c
osc_scanner.h
nothing added to commit but untracked files present (use "git add" to track)
memory handling naming scheme
Maybe it could be useful to somehow identify functions that allocate memory which needs to be freed later? Right now it's hard to tell looking at the API without looking at the specifics in the .c code or finding example code. (I just updated my o.table sorting object and had to look a bunch things up for the new version of libo)
linux build notes
I just ran across an issue with building libo on linux that we should put in a readme at some point -- I'll start making notes -- using this issue thread as a place holder.
The folder location our Makefile looks for Flex's libfl.a is /usr/local/lib, however if you install flex as root it will go into /usr/lib or even /usr/lib/x86_64-linux-gnu which is where it put it when I installed in on a test debian jessie virtual box.
Add a nonzero() function to the expression language
Migrated from CNMAT/CNMAT-odot#306
delete by address name string
could be nice to be able to delete an address by passing a string of that address, for instance when parsing SVG files, some attributes have dashes in their names, which odot doesn't like. So I'm reformatting any address that has a dash, but can't seem to delete the old name after reformatting in a lambda function using the address string.
osc_expr_det() not implemented in osc_expr.c
It appears that osc_expr_det() has not been implemented and I believe this is the reason that the odot expression 'det()' does not return anything. I can see several headaches involved in implementing this, which might be why it was left for later.
safety check on free consistancy
digging around a bit, and noticed that some free functions do safety checks and others don't which sometimes makes following code conventions a little unpredictable.
void osc_array_free(t_osc_array *ar)
{
if(ar){
osc_mem_free(ar->ar);
osc_mem_free(ar);
}
}
void osc_atom_s_free(t_osc_atom_s *a)
{
osc_mem_free(a);
}
strptime has no symbols
rm -f libo.a
libtool -static -o libo.a osc_match.o osc_bundle_s.o osc_bundle_u.o osc_bundle_iterator_s.o osc_bundle_iterator_u.o osc_error.o osc_mem.o osc_message_s.o osc_message_u.o osc_message_iterator_s.o osc_message_iterator_u.o osc_atom_s.o osc_atom_u.o osc_array.o osc_atom_array_s.o osc_atom_array_u.o osc_expr.o osc_vtable.o osc_dispatch.o osc_hashtab.o osc_linkedlist.o osc_util.o osc_rset.o osc_query.o osc_strfmt.o osc_expr_rec.o osc_typetag.o contrib/strptime.o osc_timetag.o osc_serial.o osc_scanner.o osc_expr_scanner.o osc_legacy_scanner.o osc_parser.o osc_expr_parser.o osc_legacy_parser.o /usr/local/lib/libfl.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: contrib/strptime.o has no symbols
Above is what I would consider to be the important info
Here is the full output
bison -p osc_parser_ -d -v --report=itemset -o osc_parser.c osc_parser.y
flex -o osc_scanner.c --prefix=osc_scanner_ --header-file=osc_scanner.h osc_scanner.l
bison -p osc_expr_parser_ -d -v --report=itemset -o osc_expr_parser.c osc_expr_parser.y
flex -o osc_expr_scanner.c --prefix=osc_expr_scanner_ --header-file=osc_expr_scanner.h osc_expr_scanner.l
bison -p osc_legacy_parser_ -d -v --report=itemset -o osc_legacy_parser.c osc_legacy_parser.y
flex -o osc_legacy_scanner.c --prefix=osc_legacy_scanner_ --header-file=osc_legacy_scanner.h osc_legacy_scanner.l
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_match.o osc_match.c
In file included from osc_match.c:22:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
osc_match.c:34:19: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
static const char const *_osc_match_errstr[] =
^
osc_match.c:47:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e)
^
3 warnings generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_bundle_s.o osc_bundle_s.c
In file included from osc_bundle_s.c:29:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_bundle_u.o osc_bundle_u.c
In file included from osc_bundle_u.c:30:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_bundle_iterator_s.o osc_bundle_iterator_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_bundle_iterator_u.o osc_bundle_iterator_u.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_error.o osc_error.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_mem.o osc_mem.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_message_s.o osc_message_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_message_u.o osc_message_u.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_message_iterator_s.o osc_message_iterator_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_message_iterator_u.o osc_message_iterator_u.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_atom_s.o osc_atom_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_atom_u.o osc_atom_u.c
osc_atom_u.c:129:27: warning: incompatible pointer types passing 'char *' to parameter of type 't_osc_bndl_u *' (aka 'struct _osc_bundle_u *') [-Wincompatible-pointer-types]
osc_bundle_u_free(a->w.b);
^~~~~~
./osc_bundle_u.h:55:38: note: passing argument to parameter 'bndl' here
void osc_bundle_u_free(t_osc_bndl_u *bndl);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_array.o osc_array.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_atom_array_s.o osc_atom_array_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_atom_array_u.o osc_atom_array_u.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_expr.o osc_expr.c
In file included from osc_expr.c:51:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_vtable.o osc_vtable.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_dispatch.o osc_dispatch.c
In file included from osc_dispatch.c:34:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_hashtab.o osc_hashtab.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_linkedlist.o osc_linkedlist.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_util.o osc_util.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_rset.o osc_rset.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_query.o osc_query.c
In file included from osc_query.c:35:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_strfmt.o osc_strfmt.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_expr_rec.o osc_expr_rec.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_typetag.o osc_typetag.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o contrib/strptime.o contrib/strptime.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_timetag.o osc_timetag.c
osc_timetag.c:317:53: warning: unused variable 'yrcount' [-Wunused-variable]
unsigned short int year, month, day, hour, minute, yrcount, leap = 0;
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_serial.o osc_serial.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_scanner.o osc_scanner.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_expr_scanner.o osc_expr_scanner.c
osc_expr_scanner.l:204:17: warning: unused variable 'a' [-Wunused-variable]
t_osc_atom_u *a = osc_atom_u_alloc();
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_legacy_scanner.o osc_legacy_scanner.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_parser.o osc_parser.c
In file included from osc_parser.y:46:
osc_legacy_parser.y:71:9: warning: 'YY_DECL' macro redefined [-Wmacro-redefined]
#define YY_DECL int osc_legacy_scanner_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner, long *buflen, char **buf)
^
osc_parser.y:77:9: note: previous definition is here
#define YY_DECL int osc_scanner_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner, long *buflen, char **buf)
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_expr_parser.o osc_expr_parser.c
osc_expr_parser.y:165:6: warning: unused variable 'len' [-Wunused-variable]
int len = strlen(ptr);
^
osc_expr_parser.y:984:7: warning: unused variable 'n' [-Wunused-variable]
int n = 0;
^
2 warnings generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_legacy_parser.o osc_legacy_parser.c
osc_legacy_parser.y:332:6: warning: address of array 'ptr' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(ptr){
~~ ^~~
osc_legacy_parser.y:352:6: warning: address of array 'ptr' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(ptr){
~~ ^~~
osc_legacy_parser.y:372:6: warning: address of array 'ptr' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(ptr){
~~ ^~~
osc_legacy_parser.y:392:6: warning: address of array 'ptr' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(ptr){
~~ ^~~
4 warnings generated.
rm -f libo.a
libtool -static -o libo.a osc_match.o osc_bundle_s.o osc_bundle_u.o osc_bundle_iterator_s.o osc_bundle_iterator_u.o osc_error.o osc_mem.o osc_message_s.o osc_message_u.o osc_message_iterator_s.o osc_message_iterator_u.o osc_atom_s.o osc_atom_u.o osc_array.o osc_atom_array_s.o osc_atom_array_u.o osc_expr.o osc_vtable.o osc_dispatch.o osc_hashtab.o osc_linkedlist.o osc_util.o osc_rset.o osc_query.o osc_strfmt.o osc_expr_rec.o osc_typetag.o contrib/strptime.o osc_timetag.o osc_serial.o osc_scanner.o osc_expr_scanner.o osc_legacy_scanner.o osc_parser.o osc_expr_parser.o osc_legacy_parser.o /usr/local/lib/libfl.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: contrib/strptime.o has no symbols
libo for Python 3 Swig not working with expression evaluation / function calls
Hi,
I've compiled libo from source and then created Swig and wrapped code for Python 3 and C integration.
Creating atoms, messages and bundles works well. Also the parsing of more complex bundles directly from strings.
While the parsing and serialization of bundles and expressions works the evaluation of expressions does not.
The given osc_expr_test.c file uses commands that don't exist anymore. E.g.:" osc_expr_funcall(f, &sbndl_len, &ser_bundle, &out)"
When trying to call directly into the newer: "osc_expr_eval(function, len, oscbndl, out, context)" from within Python 3 it results in Swig type errors. Especially concerning long * and the dereferencing of double pointer constructs.
Therefore, my question. Is there any newer refernce code (or any code at all) existing for usage examples of evalutaing odot expressions from within Python?
Thanks,
Tom
striptime.o has no symbols
rm -f libo.a
libtool -static -o libo.a osc_match.o osc_bundle_s.o osc_bundle_u.o osc_bundle_iterator_s.o osc_bundle_iterator_u.o osc_error.o osc_mem.o osc_message_s.o osc_message_u.o osc_message_iterator_s.o osc_message_iterator_u.o osc_atom_s.o osc_atom_u.o osc_array.o osc_atom_array_s.o osc_atom_array_u.o osc_expr.o osc_vtable.o osc_dispatch.o osc_hashtab.o osc_linkedlist.o osc_util.o osc_rset.o osc_query.o osc_strfmt.o osc_expr_rec.o osc_typetag.o contrib/strptime.o osc_timetag.o osc_serial.o osc_scanner.o osc_expr_scanner.o osc_legacy_scanner.o osc_parser.o osc_expr_parser.o osc_legacy_parser.o /usr/local/lib/libfl.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: contrib/strptime.o has no symbols
Above is what I would consider to be the important info
Here is the full output
bison -p osc_parser_ -d -v --report=itemset -o osc_parser.c osc_parser.y
flex -o osc_scanner.c --prefix=osc_scanner_ --header-file=osc_scanner.h osc_scanner.l
bison -p osc_expr_parser_ -d -v --report=itemset -o osc_expr_parser.c osc_expr_parser.y
flex -o osc_expr_scanner.c --prefix=osc_expr_scanner_ --header-file=osc_expr_scanner.h osc_expr_scanner.l
bison -p osc_legacy_parser_ -d -v --report=itemset -o osc_legacy_parser.c osc_legacy_parser.y
flex -o osc_legacy_scanner.c --prefix=osc_legacy_scanner_ --header-file=osc_legacy_scanner.h osc_legacy_scanner.l
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_match.o osc_match.c
In file included from osc_match.c:22:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
osc_match.c:34:19: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
static const char const *_osc_match_errstr[] =
^
osc_match.c:47:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e)
^
3 warnings generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_bundle_s.o osc_bundle_s.c
In file included from osc_bundle_s.c:29:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_bundle_u.o osc_bundle_u.c
In file included from osc_bundle_u.c:30:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_bundle_iterator_s.o osc_bundle_iterator_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_bundle_iterator_u.o osc_bundle_iterator_u.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_error.o osc_error.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_mem.o osc_mem.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_message_s.o osc_message_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_message_u.o osc_message_u.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_message_iterator_s.o osc_message_iterator_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_message_iterator_u.o osc_message_iterator_u.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_atom_s.o osc_atom_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_atom_u.o osc_atom_u.c
osc_atom_u.c:129:27: warning: incompatible pointer types passing 'char *' to parameter of type 't_osc_bndl_u *' (aka 'struct _osc_bundle_u *') [-Wincompatible-pointer-types]
osc_bundle_u_free(a->w.b);
^~~~~~
./osc_bundle_u.h:55:38: note: passing argument to parameter 'bndl' here
void osc_bundle_u_free(t_osc_bndl_u *bndl);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_array.o osc_array.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_atom_array_s.o osc_atom_array_s.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_atom_array_u.o osc_atom_array_u.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_expr.o osc_expr.c
In file included from osc_expr.c:51:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_vtable.o osc_vtable.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_dispatch.o osc_dispatch.c
In file included from osc_dispatch.c:34:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_hashtab.o osc_hashtab.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_linkedlist.o osc_linkedlist.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_util.o osc_util.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_rset.o osc_rset.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_query.o osc_query.c
In file included from osc_query.c:35:
./osc_match.h:74:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *osc_match_errstr(unsigned long e);
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_strfmt.o osc_strfmt.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_expr_rec.o osc_expr_rec.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_typetag.o osc_typetag.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o contrib/strptime.o contrib/strptime.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_timetag.o osc_timetag.c
osc_timetag.c:317:53: warning: unused variable 'yrcount' [-Wunused-variable]
unsigned short int year, month, day, hour, minute, yrcount, leap = 0;
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_serial.o osc_serial.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_scanner.o osc_scanner.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_expr_scanner.o osc_expr_scanner.c
osc_expr_scanner.l:204:17: warning: unused variable 'a' [-Wunused-variable]
t_osc_atom_u *a = osc_atom_u_alloc();
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_legacy_scanner.o osc_legacy_scanner.c
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_parser.o osc_parser.c
In file included from osc_parser.y:46:
osc_legacy_parser.y:71:9: warning: 'YY_DECL' macro redefined [-Wmacro-redefined]
#define YY_DECL int osc_legacy_scanner_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner, long *buflen, char **buf)
^
osc_parser.y:77:9: note: previous definition is here
#define YY_DECL int osc_scanner_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner, long *buflen, char **buf)
^
1 warning generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_expr_parser.o osc_expr_parser.c
osc_expr_parser.y:165:6: warning: unused variable 'len' [-Wunused-variable]
int len = strlen(ptr);
^
osc_expr_parser.y:984:7: warning: unused variable 'n' [-Wunused-variable]
int n = 0;
^
2 warnings generated.
clang -Wall -Wno-trigraphs -fno-strict-aliasing -O3 -funroll-loops -std=c99 -arch x86_64 -I/usr/include -c -o osc_legacy_parser.o osc_legacy_parser.c
osc_legacy_parser.y:332:6: warning: address of array 'ptr' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(ptr){
~~ ^~~
osc_legacy_parser.y:352:6: warning: address of array 'ptr' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(ptr){
~~ ^~~
osc_legacy_parser.y:372:6: warning: address of array 'ptr' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(ptr){
~~ ^~~
osc_legacy_parser.y:392:6: warning: address of array 'ptr' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(ptr){
~~ ^~~
4 warnings generated.
rm -f libo.a
libtool -static -o libo.a osc_match.o osc_bundle_s.o osc_bundle_u.o osc_bundle_iterator_s.o osc_bundle_iterator_u.o osc_error.o osc_mem.o osc_message_s.o osc_message_u.o osc_message_iterator_s.o osc_message_iterator_u.o osc_atom_s.o osc_atom_u.o osc_array.o osc_atom_array_s.o osc_atom_array_u.o osc_expr.o osc_vtable.o osc_dispatch.o osc_hashtab.o osc_linkedlist.o osc_util.o osc_rset.o osc_query.o osc_strfmt.o osc_expr_rec.o osc_typetag.o contrib/strptime.o osc_timetag.o osc_serial.o osc_scanner.o osc_expr_scanner.o osc_legacy_scanner.o osc_parser.o osc_expr_parser.o osc_legacy_parser.o /usr/local/lib/libfl.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: contrib/strptime.o has no symbols
add strlen()
thanks for the empty strings! ""
osc_expr.h reports misplaced `}` in C++
osc_expr.h contains the following typo:
#ifdef __cplusplus
extern "C" {
#endif
and on the bottom:
#ifdef _cplusplus
}
#endif
What's hard to see is that _cplusplus
contains two underscores on top, and one on the bottom.
o.expr memory leak
check if arg1 free rules with goto cleanup in assignToBundleMember
free_arg1
should probably be initialized higher in the function --> https://github.com/CNMAT/libo/blob/master/osc_expr.c#L1853
but it's not clear to me yet, when arg1 should be freed as an atom_array
cleanup:
if(arg1 && free_arg1){
osc_atom_array_u_free(arg1);
}
make fails on OSX 10.15; libfl.a not where libo expects
When attempting make on OSX 10.15 one gets the following error:
'error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /usr/local/lib/libfl.a (No such file or directory)'
I think this is because 'brew install flex' no longer writes libfl.a to this location, but rather to /usr/local/opt/flex/lib
I copied the file to the expected location and make completes.
timetag leap year
I think there might be a bug in the leap year lookup in osc_timetag.c -- I was just repurposing some of this code for OSC-timetag, and came across an issue with the year 2000 not being identified as a leap year. Not sure if it matters for o.timetag but it might so putting this note in for future inspection.
here's the fix I used in OSC-timetag-ops.c (mainly adding 1900 to t.tm_year
in the test, and taking out the -1 offset from t.tm_mday
)
uint32_t sec = 0;
for(int i = 0; i < t.tm_year; i++){
sec += SEC_PER_YEAR;
if(osc_timetag_isleap(i + 1900)){
sec += SEC_PER_DAY;
}
}
int leap = osc_timetag_isleap(t.tm_year + 1900);
int days_in_months[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
int offset = leap && (t.tm_mon > 1) ? 1 : 0;
sec += ((days_in_months[t.tm_mon] + offset + t.tm_mday ) * SEC_PER_DAY);
bitwise opertators
would be nice to have the complete set of bitwise operators in odot expr lang.
one use case would be porting this type of thing to odot: http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
The == and != operators should work on bundles
This should just be done with memcmp
, same as o.change
.
"undefined symbol: fabs" error on linux
Hello! I built libo.so on linux, and it seems to build alright, but when odot tries to load it, it tells me "Could not register handle for external module: libo: undefined symbol: fabs.". fabs is a c++ command, so it seems to not find some library?
check expr_parser.y file for leaks
there may be some leaks in the expr_parser rules, were $1 is not freed before returning (in particular when returning 1).
Add a match() function
match(<pattern>, [<addresses>])
Should produce a bundle with
{
/full : {},
/partial : {},
/unmatched : {}
}
explode performance
explode seems really slow, not sure if this is new or not, but might be worth seeing if we can optimize this a bit in the new version?
o.expr needs a higher-order sort and sortidx
Since sort and sortidx are already varargs functions, we'll need two new versions of these.
parsing large numbers append unnecessary '.' to represented number
...When reformatting in scientific notation.
Discovered this in Max, ala o.compose.
----------begin_max5_patcher----------
588.3ocyUssiaBCD8Y3q.4WKKwl6zekxpHGvIqWA1HvDksQ4euiGSRIYqp1p
cenHhS7wysy34nb12irSeRLQB9dvOB77N664gPV.uk8djd9olN9DZFQG0n6G
zSBRn6Ti3jAOYSyrXSL7qy0pZyFirWroeB1mSgmnPDUw6E.TMQpLi5.vkf3Z
Rs5x0v0IUhF8rBiY5B3.2z7hTcX6nnw3p1hrxHZXPYVVTg8gEFjVfP4zHZvy
KdpmMcBi4sAgyMB41QxVGg185Srx0roQ2oGclSiXkkgO7EaU72qUl87FL5zU
XSxehXLv3EX0buTAEC1GiuxrQwjPY3FoVslc4UH6RJtwNpEXM0f34XGFP1B5
D+nnc6tYUamXamPcv7BdLs7OYPK2vcYLIKLnxRNVgcAxEihKVLpM+efWa2IE
7up5ZfnLGR1MaRSgO4uy0h3vulZHN0kQFK25UlcoZUk31wxt2KaUgIy8lCae
hAFVj+QxDropXchtOt+NYt5AYFVdL7Xvgj3G6ZVDrqE7r8h6huucI7SKSAQn
UnxRupTuSqxhRpxDeil6zqqUrBUqSqVa92Uq4I1wWXR9qPsV7emZ8cr6yoVo
+cs5cSDXFH7ggihwIntvgB6HALP7pqyTDhakJ2VL5jQwQ4U6yQD9HbsY.VMO
hcCxoxbhyUcqXTMKwR22NFBobx7V2i+2gcXAcsetyHm5jfeTJyceQZE64.98
is6Nb2MHMgkTjX6cYofXvJ+hRqJoIUKWkNp6B3.eDtNvBAy5RdvjiLcoC4ew
+W.8AD4i
-----------end_max5_patcher-----------
README
This repo needs a readme.
Here are guidelines that should be followed:
https://gist.github.com/indexzero/1363524
8-bit ints need a text representation that handles non-printable characters
----------begin_max5_patcher----------
350.3ocoRErSCCCC8bxWQTt.HUJMckoARbkybeZBkklAYzkDkjN0wz92owoi
sw3vPbot19Y+rewawH5bSmzSIORlRPnsXDBBECfF7QzU7NQC2Cvnl7Zk21v2
PyRYCxt.j4NQrMWsO9BiN3UeJi4Xk4ECgMsgFYHrwJSrRojYCor7f3ck9sWc
RQHkkMl0WIg8vXvbeQzLpJu36hzsqT59NBSG6HtWvE.EEG.l39Djp5zVMe4s
kzXncXb7S1EKGxNqKWXpkQf+hl7DYpRGlbcwMYD3mppal8WEomaaZdgK9PFn
Ym3cIhW0HvLoBDux+u3Udt3wNV7f9SaT5edZACYL9oJp2z5D6W0T2xHGlxZo
Onz7fxnOBSYByYzxs10Rme.LPQ+S1RiK5NICbU5jKrxTmbsZOdFrwTtqWLC8
JYqClKZ23JZp19WZmtUAfwwKkdNg6AMekzaGDN3rAuC+E.PaNKB
-----------end_max5_patcher-----------
Empty bundle literal is missing in o.compose and o.expr
should be able to do
/foo : {}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.