Skip to content

Commit

Permalink
Removed unused stdbool.h
Browse files Browse the repository at this point in the history
Replaced all include guards with '#pragma once' - fixes OpenKinect#296

Signed-off-by: Benn Snyder <[email protected]>
  • Loading branch information
piedar committed Jun 19, 2013
1 parent a6c5dd0 commit 287bc2e
Show file tree
Hide file tree
Showing 21 changed files with 24 additions and 114 deletions.
7 changes: 1 addition & 6 deletions include/libfreenect-audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef LIBFREENECT_AUDIO_H
#define LIBFREENECT_AUDIO_H
#pragma once

#include <libfreenect.h>
#include <stdint.h>
Expand Down Expand Up @@ -114,7 +113,3 @@ FREENECTAPI int freenect_stop_audio(freenect_device* dev);
#ifdef __cplusplus
}
#endif

#endif //


5 changes: 1 addition & 4 deletions include/libfreenect-registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef LIBFREENECT_REGISTRATION_H
#define LIBFREENECT_REGISTRATION_H
#pragma once

#include <libfreenect.h>
#include <stdint.h>
Expand Down Expand Up @@ -125,5 +124,3 @@ FREENECTAPI void freenect_camera_to_world(freenect_device* dev,
#ifdef __cplusplus
}
#endif

#endif // LIBFREENECT_REGISTRATION_H
6 changes: 1 addition & 5 deletions include/libfreenect.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef LIBFREENECT_H
#define LIBFREENECT_H
#pragma once

#include <stdint.h>

Expand Down Expand Up @@ -618,6 +617,3 @@ FREENECTAPI int freenect_set_depth_mode(freenect_device* dev, const freenect_fra
#ifdef __cplusplus
}
#endif

#endif //

10 changes: 4 additions & 6 deletions platform/windows/README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ on using the C-compiler to compile .c files (this happens with MSVC versions pri
2010). To work around this, just set the "Compile As" to "Default", click "Apply" and
then set it back to "Compile as C++ Code (/TP)", click "Apply" and then "OK".

Another problem is that Visual C++ does not offer the <unistd.h> and <stdbool.h>
headers. However, they are pretty simple to be emulated; the <stdbool.h> will
actually be a dummy header because C++ already defines the "bool" type semantics,
while the <unistd.h> has to simply #include <stdint.h> and define the "ssize_t"
type. The implementation of these headers are located at:
"libfreenect\platform\windows"
Another problem is that Visual C++ does not offer <unistd.h>. However, it
can be emulated by #include <stdint.h> and defining the "ssize_t" type.
The implementation of <unistd.h> is located at:
"libfreenect\platform\windows\unistd.h"

NOTE: MSVC versions prior to 2010 do not provide the <stdint.h> header. An ISO C9x
compilant <stdint.h> header for such MSVC versions can be found at the wikipedia entry
Expand Down
5 changes: 1 addition & 4 deletions platform/windows/libusb10emu/libusb-1.0/failguard.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef LIBUSBEMU_FAIL_GUARD_H
#define LIBUSBEMU_FAIL_GUARD_H
#pragma once

namespace libusbemu
{
Expand All @@ -12,5 +11,3 @@ namespace libusbemu
const bool Abort();
}
}

#endif//LIBUSBEMU_FAIL_GUARD_H
5 changes: 1 addition & 4 deletions platform/windows/libusb10emu/libusb-1.0/libusb.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef LIBUSB_1_0_INTERFACE_EMULATOR_FOR_LIBUSB_0_1_H
#define LIBUSB_1_0_INTERFACE_EMULATOR_FOR_LIBUSB_0_1_H
#pragma once

// This interface emulator requires the libusb-win32 v1.2.2.1 (snapshot)
// or later. Prior win32 versions of the library were not conformal to
Expand Down Expand Up @@ -198,5 +197,3 @@ enum libusb_error
#ifdef __cplusplus
}
#endif

#endif//LIBUSB_1_0_INTERFACE_EMULATOR_FOR_LIBUSB_0_1_H
5 changes: 1 addition & 4 deletions platform/windows/libusb10emu/libusb-1.0/libusbemu_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef LIBUSB_EMULATOR_INTERNAL_H
#define LIBUSB_EMULATOR_INTERNAL_H
#pragma once

#include "libusbemu_threads.h"
#include <lusb0_usb.h>
Expand Down Expand Up @@ -413,5 +412,3 @@ void libusbemu_clear_transfer(transfer_wrapper* wrapper)
}

} // end of 'namespace libusbemu'

#endif//LIBUSB_EMULATOR_INTERNAL_H
7 changes: 2 additions & 5 deletions platform/windows/libusb10emu/libusb-1.0/libusbemu_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef LIBUSBEMU_THREAD_INTERFACE_WRAPPER_H
#define LIBUSBEMU_THREAD_INTERFACE_WRAPPER_H
#pragma once

// Wrappers for platform-specific thread/synchronization objects:
// * Thread
Expand Down Expand Up @@ -56,6 +55,4 @@ struct RAIIMutex
~RAIIMutex() { m_mutex.Leave(); }
};

};

#endif//LIBUSBEMU_THREAD_INTERFACE_WRAPPER_H
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef LIBUSBEMU_THREAD_INTERFACE_WRAPPER_FOR_WIN32_THREADS_H
#define LIBUSBEMU_THREAD_INTERFACE_WRAPPER_FOR_WIN32_THREADS_H
#pragma once

#include <windows.h>
#include <stdio.h>
Expand Down Expand Up @@ -320,5 +319,3 @@ struct EventList
};

} //end of 'namespace libusbemu'

#endif//LIBUSBEMU_THREAD_INTERFACE_WRAPPER_FOR_WIN32_THREADS_H
30 changes: 0 additions & 30 deletions platform/windows/stdbool.h

This file was deleted.

5 changes: 1 addition & 4 deletions platform/windows/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef _WINDOWS_UNISTD_EMULATED_H_
#define _WINDOWS_UNISTD_EMULATED_H_
#pragma once

#include <stdint.h>

Expand All @@ -36,5 +35,3 @@
#define _SSIZE_T_
typedef long ssize_t;
#endif // _SSIZE_T_

#endif//_WINDOWS_UNISTD_EMULATED_H_
6 changes: 1 addition & 5 deletions src/cameras.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef CAMERAS_H
#define CAMERAS_H
#pragma once

#include "libfreenect.h"

Expand All @@ -35,6 +34,3 @@
// camera-specific protocol support.
int freenect_camera_init(freenect_device *dev);
int freenect_camera_teardown(freenect_device *dev);

#endif

5 changes: 1 addition & 4 deletions src/freenect_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef FREENECT_INTERNAL_H
#define FREENECT_INTERNAL_H
#pragma once

#include <stdint.h>

Expand Down Expand Up @@ -240,5 +239,3 @@ struct _freenect_device {
fnusb_dev usb_motor;
freenect_raw_tilt_state raw_state;
};

#endif
5 changes: 1 addition & 4 deletions src/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef __LOADER_H__
#define __LOADER_H__
#pragma once

#include <stdint.h>
#include "usb_libusb10.h"
Expand Down Expand Up @@ -56,5 +55,3 @@ typedef struct {

int upload_firmware(fnusb_dev* dev);
int upload_cemd_data(fnusb_dev* dev);

#endif //__LOADER_H__
5 changes: 1 addition & 4 deletions src/registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
* either License.
*/

#ifndef REGISTRATION_H
#define REGISTRATION_H
#pragma once

#include "libfreenect.h"

// Internal function declarations relating to registration
int freenect_init_registration(freenect_device* dev);
int freenect_apply_registration(freenect_device* dev, uint8_t* input_packed, uint16_t* output_mm);
int freenect_apply_depth_to_mm(freenect_device* dev, uint8_t* input_packed, uint16_t* output_mm);

#endif
1 change: 0 additions & 1 deletion src/usb_libusb10.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Expand Down
5 changes: 1 addition & 4 deletions src/usb_libusb10.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef USB_LIBUSB10
#define USB_LIBUSB10
#pragma once

#include "libfreenect.h"
#include <libusb.h>
Expand Down Expand Up @@ -103,5 +102,3 @@ int fnusb_control(fnusb_dev *dev, uint8_t bmRequestType, uint8_t bRequest, uint1
int fnusb_bulk(fnusb_dev *dev, uint8_t endpoint, uint8_t *data, int len, int *transferred);
int fnusb_num_interfaces(fnusb_dev *dev);
#endif

#endif
5 changes: 1 addition & 4 deletions wrappers/actionscript/server/as3_jpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef SERVER_JPEG_H
#define SERVER_JPEG_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -40,5 +39,3 @@ int RGB_2_JPEG(unsigned char *buffer, unsigned char **compressed, long unsigned
#ifdef __cplusplus
}
#endif

#endif
5 changes: 1 addition & 4 deletions wrappers/actionscript/server/freenect_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* either License.
*/

#ifndef FREENECT_SERVER_H
#define FREENECT_SERVER_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -62,5 +61,3 @@ extern "C" {
#ifdef __cplusplus
}
#endif

#endif
6 changes: 2 additions & 4 deletions wrappers/c_sync/libfreenect_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* either License.
*/

#ifndef FREENECT_SYNC_H
#define FREENECT_SYNC_H
#pragma once

#include <libfreenect.h>
#include <stdint.h>

Expand Down Expand Up @@ -104,5 +104,3 @@ void freenect_sync_stop(void);
#ifdef __cplusplus
}
#endif

#endif
5 changes: 1 addition & 4 deletions wrappers/opencv/libfreenect_cv.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef FREENECT_CV_H
#define FREENECT_CV_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -13,5 +12,3 @@ extern "C" {
#ifdef __cplusplus
}
#endif

#endif

0 comments on commit 287bc2e

Please sign in to comment.