diff options
author | Determinant <[email protected]> | 2015-05-25 16:12:15 +0800 |
---|---|---|
committer | Determinant <[email protected]> | 2015-05-25 16:12:15 +0800 |
commit | f6c23565901561cfe1d7c3c29266ee60ce1f7bdd (patch) | |
tree | 11e4498a19248281eb12039143202280a8720b99 | |
parent | be922fa355fe385b45a2720d48eaf0c809e1874a (diff) |
...
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | examples/oop_example.c | 5 | ||||
-rw-r--r-- | io/param.c | 4 |
3 files changed, 8 insertions, 7 deletions
@@ -1,5 +1,8 @@ .PHONY: all clean luajit -OBJS := oop_example.o nerv.o luaT.o common.o matrix/mmatrix.o matrix/cumatrix.o matrix/init.o matrix/cukernel.o io/init.o io/param.o +OBJS := nerv.o luaT.o common.o \ + matrix/mmatrix.o matrix/cumatrix.o matrix/init.o matrix/cukernel.o \ + io/init.o io/param.o \ + examples/oop_example.o LIBS := libnerv.so LUA_LIBS := matrix/init.lua io/init.lua nerv.lua pl/utils.lua pl/compat.lua INCLUDE := -I build/luajit-2.0/include/luajit-2.0/ -DLUA_USE_APICHECK @@ -27,6 +30,7 @@ $(OBJ_DIR): -mkdir -p $(OBJ_DIR)/io -mkdir -p $(LUA_DIR)/io -mkdir -p $(LUA_DIR)/pl + -mkdir -p $(OBJ_DIR)/examples $(LUA_DIR): -mkdir -p $(LUA_DIR) $(OBJ_DIR)/%.o: %.c diff --git a/examples/oop_example.c b/examples/oop_example.c index e9a4ffe..89f5994 100644 --- a/examples/oop_example.c +++ b/examples/oop_example.c @@ -1,10 +1,7 @@ #include <math.h> -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" -#include "luaT/luaT.h" #include <stdio.h> #include <stdlib.h> +#include "../common.h" const char *point_tname = "nerv.Point"; @@ -39,7 +39,7 @@ size_t read_param_header_plain(FILE *fp, int *status) { for (i = 0; i < PARAM_HEADER_SIZE; i++) if (isdigit(buff[i])) size = size * 10 + buff[i] - '0'; - fprintf(stderr, "header: %d\n", size); + fprintf(stderr, "header: %lu\n", size); return size; } @@ -145,7 +145,7 @@ int nerv_param_file_open_read(lua_State *L, const char *fn) { pci = (ParamChunkInfo *)malloc(sizeof(ParamChunkInfo)); pci->offset = ftello(fp); pci->length = param_len - (pci->offset - offset); - fprintf(stderr, "%d + %d (skip %d)\n", (int)pci->offset, + fprintf(stderr, "%d + %d (skip %lu)\n", (int)pci->offset, (int)pci->length, param_len); luaT_pushudata(L, pci, nerv_param_chunk_info_tname); lua_setfield(L, -2, "chunk"); |