Skip to content

Commit

Permalink
Clean up majority of Compiler Warnings
Browse files Browse the repository at this point in the history
Jenkins complaining "code unstable" due to high
number of compiler warnings.
  • Loading branch information
mdhorn committed Jul 11, 2016
1 parent 197acd1 commit 726b1f7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ BACKEND := LIBUVC
endif

LIBUSB_FLAGS := `pkg-config --cflags --libs libusb-1.0`

CFLAGS := -std=c11 -fPIC -pedantic -DRS_USE_$(BACKEND)_BACKEND $(LIBUSB_FLAGS)
CFLAGS := -std=c11 -D_BSD_SOURCE -fPIC -pedantic -DRS_USE_$(BACKEND)_BACKEND $(LIBUSB_FLAGS)
CXXFLAGS := -std=c++11 -fPIC -pedantic -Ofast -Wno-missing-field-initializers
CXXFLAGS += -Wno-switch -Wno-multichar -DRS_USE_$(BACKEND)_BACKEND $(LIBUSB_FLAGS)
CXXFLAGS += -Wno-switch -Wno-multichar -DRS_USE_$(BACKEND)_BACKEND $(LIBUSB_FLAGS)

# Add specific include paths for OSX
ifeq ($(uname_S),Darwin)
Expand All @@ -33,7 +32,7 @@ endif
endif

# Compute list of all *.o files that participate in librealsense.so
OBJECTS = verify
OBJECTS = verify
OBJECTS += $(notdir $(basename $(wildcard src/*.cpp)))
OBJECTS += $(addprefix libuvc/, $(notdir $(basename $(wildcard src/libuvc/*.c))))
OBJECTS := $(addprefix obj/, $(addsuffix .o, $(OBJECTS)))
Expand Down Expand Up @@ -93,7 +92,7 @@ lib/librealsense.so: prepare $(OBJECTS)

lib/librealsense.a: prepare $(OBJECTS)
ar rvs $@ `find obj/ -name "*.o"`

# Rules for compiling librealsense source
obj/%.o: src/%.cpp
$(CXX) $< $(CXXFLAGS) -c -o $@
Expand Down
8 changes: 4 additions & 4 deletions src/libuvc/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ uvc_error_t uvc_open2(
UVC_DEBUG("libusb_submit_transfer() = %d", ret);

if (ret) {
UVC_DEBUG("device has a status interrupt endpoint, but unable to read from it");
UVC_DEBUG("device has a status interrupt endpoint, but unable to read from it",);
goto fail;
}
}
Expand Down Expand Up @@ -1493,7 +1493,7 @@ void uvc_process_status_xfer(uvc_device_handle_t *devh, struct libusb_transfer *
selector = transfer->buffer[3];

if (originator == 0) {
UVC_DEBUG("Unhandled update from VC interface");
UVC_DEBUG("Unhandled update from VC interface", );
UVC_EXIT_VOID();
return; /* @todo VideoControl virtual entity interface updates */
}
Expand Down Expand Up @@ -1537,7 +1537,7 @@ void uvc_process_status_xfer(uvc_device_handle_t *devh, struct libusb_transfer *
break;
}
case 2: /* VideoStreaming interface */
UVC_DEBUG("Unhandled update from VideoStreaming interface");
UVC_DEBUG("Unhandled update from VideoStreaming interface",);
UVC_EXIT_VOID();
return; /* @todo VideoStreaming updates */
}
Expand All @@ -1546,7 +1546,7 @@ void uvc_process_status_xfer(uvc_device_handle_t *devh, struct libusb_transfer *
status_class, event, selector, attribute, data_len);

if(devh->status_cb) {
UVC_DEBUG("Running user-supplied status callback");
UVC_DEBUG("Running user-supplied status callback",);
devh->status_cb(status_class,
event,
selector,
Expand Down
2 changes: 1 addition & 1 deletion src/libuvc/diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void uvc_print_diag(uvc_device_handle_t *devh, FILE *stream) {
case UVC_VS_FORMAT_MJPEG:
case UVC_VS_FORMAT_FRAME_BASED:
fprintf(stream,
"\t\%s(%d)\n"
"\t\t%s(%d)\n"
"\t\t bits per pixel: %d\n"
"\t\t GUID: ",
_uvc_name_for_format_subtype(fmt_desc->bDescriptorSubtype),
Expand Down
6 changes: 3 additions & 3 deletions src/libuvc/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ void _uvc_process_payload(uvc_stream_handle_t *strmh, uint8_t *payload, size_t p
header_info = payload[1];

if (header_info & 0x40) {
UVC_DEBUG("bad packet: error bit set");
UVC_DEBUG("bad packet: error bit set",);
return;
}

Expand Down Expand Up @@ -816,7 +816,7 @@ uvc_error_t uvc_stream_start(
altsetting->bInterfaceNumber,
altsetting->bAlternateSetting);
if (ret != UVC_SUCCESS) {
UVC_DEBUG("libusb_set_interface_alt_setting failed");
UVC_DEBUG("libusb_set_interface_alt_setting failed",);
goto fail;
}

Expand Down Expand Up @@ -874,7 +874,7 @@ uvc_error_t uvc_stream_start(
ret = libusb_submit_transfer(strmh->transfers[transfer_id]);
if (ret != UVC_SUCCESS)
{
UVC_DEBUG("libusb_submit_transfer failed");
UVC_DEBUG("libusb_submit_transfer failed",);
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/uvc-v4l2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

#include <libusb.h>

#pragma GCC diagnostic ignored "-Woverflow"

namespace rsimpl
{
namespace uvc
Expand Down

0 comments on commit 726b1f7

Please sign in to comment.