Skip to content

Commit

Permalink
[change] compile options for unused-parameter to suite standards
Browse files Browse the repository at this point in the history
  • Loading branch information
bellbind committed Oct 12, 2013
1 parent abb5f51 commit 53a0ffd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
15 changes: 10 additions & 5 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{"targets": [
{"target_name": "v4l2camera", "sources": ["capture.c", "v4l2camera.cc"],
"cflags": ["-Wall", "-Wextra", "-pedantic"],
"cflags_c": ["-std=c11"], "cflags_cc": ["-std=c++11"]}
]}
{
"targets": [{
"target_name": "v4l2camera",
"sources": ["capture.c", "v4l2camera.cc"],
"cflags": ["-Wall", "-Wextra", "-pedantic"],
"cflags_c": ["-std=c11", "-Wno-unused-parameter"],
"cflags_cc": ["-std=c++11"]
}]
}

2 changes: 1 addition & 1 deletion c-examples.makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# make -f c-examples.makefile

CC = gcc
CFLAGS = -std=c11 -Wall -Wextra -pedantic
CFLAGS = -std=c11 -Wall -Wextra -Wno-unused-parameter -pedantic
all: capture-jpeg list-controls list-formats

capture-jpeg: capture.h capture.c c-examples/capture-jpeg.c
Expand Down
5 changes: 1 addition & 4 deletions capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ void camera_format_name(uint32_t format_id, char* name)
}

static void log_stderr(camera_log_t type, const char* msg, void* pointer) {
(void) pointer;
switch (type) {
case CAMERA_ERROR:
fprintf(stderr, "ERROR [%s] %d: %s\n", msg, errno, strerror(errno));
Expand Down Expand Up @@ -175,7 +174,7 @@ static bool camera_load_settings(camera_t* camera)
static bool camera_set_config(camera_t* camera, camera_config_t* config)
{
if (config->width > 0 && config->height > 0) {
uint32_t pixformat = config->format || V4L2_PIX_FMT_YUYV;
uint32_t pixformat = config->format ? config->format : V4L2_PIX_FMT_YUYV;
struct v4l2_format format;
memset(&format, 0, sizeof format);
format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
Expand Down Expand Up @@ -288,7 +287,6 @@ static inline int minmax(int min, int v, int max)
}
static inline uint8_t yuv2r(int y, int u, int v)
{
(void) u;
return minmax(0, (y + 359 * v) >> 8, 255);
}
static inline uint8_t yuv2g(int y, int u, int v)
Expand All @@ -297,7 +295,6 @@ static inline uint8_t yuv2g(int y, int u, int v)
}
static inline uint8_t yuv2b(int y, int u, int v)
{
(void) v;
return minmax(0, (y + 454 * u) >> 8, 255);
}
uint8_t* yuyv2rgb(uint8_t* yuyv, uint32_t width, uint32_t height)
Expand Down
2 changes: 1 addition & 1 deletion v4l2camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ struct CaptureData {
static void cameraCaptureClose(uv_handle_t* handle) {
delete handle;
}
static void cameraCaptureCB(uv_poll_t* handle, int status, int events)
static void cameraCaptureCB(uv_poll_t* handle, int /*status*/, int /*events*/)
{
v8::HandleScope scope;
auto data = static_cast<CaptureData*>(handle->data);
Expand Down

0 comments on commit 53a0ffd

Please sign in to comment.