banish all c++-style comments
This commit is contained in:
@@ -23,24 +23,24 @@
|
||||
|
||||
#include <wiiuse.h>
|
||||
|
||||
#include <SDL.h> // for SDL_Init, SDL_Quit
|
||||
#include <SDL_error.h> // for SDL_GetError
|
||||
#include <SDL_events.h> // for SDL_Event, SDL_PollEvent, etc
|
||||
#include <SDL_video.h> // for SDL_GL_SetAttribute, etc
|
||||
#include <SDL.h> /* for SDL_Init, SDL_Quit */
|
||||
#include <SDL_error.h> /* for SDL_GetError */
|
||||
#include <SDL_events.h> /* for SDL_Event, SDL_PollEvent, etc */
|
||||
#include <SDL_video.h> /* for SDL_GL_SetAttribute, etc */
|
||||
|
||||
#include <GL/gl.h> // for glVertex3f, GLfloat, etc
|
||||
#include <GL/glu.h> // for gluLookAt, gluOrtho2D, etc
|
||||
#include <GL/glut.h> // for glutSolidTeapot
|
||||
#include <GL/gl.h> /* for glVertex3f, GLfloat, etc */
|
||||
#include <GL/glu.h> /* for gluLookAt, gluOrtho2D, etc */
|
||||
#include <GL/glut.h> /* for glutSolidTeapot */
|
||||
|
||||
#ifndef WIIUSE_WIN32
|
||||
#include <sys/time.h> // for timeval, gettimeofday
|
||||
#include <time.h> // for time
|
||||
#include <unistd.h> // for usleep
|
||||
#include <sys/time.h> /* for timeval, gettimeofday */
|
||||
#include <time.h> /* for time */
|
||||
#include <unistd.h> /* for usleep */
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h> // for printf
|
||||
#include <stdio.h> /* for printf */
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
#define PI_DIV_180 0.017453292519943296
|
||||
@@ -326,7 +326,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
int found, connected;
|
||||
int wm;
|
||||
|
||||
//printf("wiiuse version = %s\n", wiiuse_version());
|
||||
/* printf("wiiuse version = %s\n", wiiuse_version()); */
|
||||
|
||||
wiimotes = wiiuse_init(MAX_WIIMOTES);
|
||||
found = wiiuse_find(wiimotes, MAX_WIIMOTES, 5);
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
* This file is an example of how to use the wiiuse library.
|
||||
*/
|
||||
|
||||
#include <stdio.h> // for printf
|
||||
#include <stdio.h> /* for printf */
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h> // for usleep
|
||||
#include <unistd.h> /* for usleep */
|
||||
#endif
|
||||
|
||||
#include "wiiuse.h" // for wiimote_t, classic_ctrl_t, etc
|
||||
#include "wiiuse.h" /* for wiimote_t, classic_ctrl_t, etc */
|
||||
|
||||
|
||||
#define MAX_WIIMOTES 4
|
||||
@@ -187,8 +187,8 @@ void handle_event(struct wiimote_t* wm) {
|
||||
float x = ((wb->tr + wb->br) / total) * 2 - 1;
|
||||
float y = ((wb->tl + wb->tr) / total) * 2 - 1;
|
||||
printf("Weight: %f kg @ (%f, %f)\n", total, x, y);
|
||||
//printf("Interpolated weight: TL:%f TR:%f BL:%f BR:%f\n", wb->tl, wb->tr, wb->bl, wb->br);
|
||||
//printf("Raw: TL:%d TR:%d BL:%d BR:%d\n", wb->rtl, wb->rtr, wb->rbl, wb->rbr);
|
||||
/* printf("Interpolated weight: TL:%f TR:%f BL:%f BR:%f\n", wb->tl, wb->tr, wb->bl, wb->br); */
|
||||
/* printf("Raw: TL:%d TR:%d BL:%d BR:%d\n", wb->rtl, wb->rtr, wb->rbl, wb->rbr); */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ int main(int argc, char** argv) {
|
||||
* if any expansions are plugged into the wiimote or
|
||||
* what LEDs are lit.
|
||||
*/
|
||||
//wiiuse_status(wiimotes[0]);
|
||||
/* wiiuse_status(wiimotes[0]); */
|
||||
|
||||
/*
|
||||
* This is the main loop
|
||||
@@ -406,8 +406,8 @@ int main(int argc, char** argv) {
|
||||
* threshold values. By default they are the same
|
||||
* as the wiimote.
|
||||
*/
|
||||
//wiiuse_set_nunchuk_orient_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 90.0f);
|
||||
//wiiuse_set_nunchuk_accel_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 100);
|
||||
/* wiiuse_set_nunchuk_orient_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 90.0f); */
|
||||
/* wiiuse_set_nunchuk_accel_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 100); */
|
||||
printf("Nunchuk inserted.\n");
|
||||
break;
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
*/
|
||||
|
||||
#include "classic.h"
|
||||
#include "dynamics.h" // for calc_joystick_state
|
||||
#include "events.h" // for handshake_expansion
|
||||
#include "dynamics.h" /* for calc_joystick_state */
|
||||
#include "events.h" /* for handshake_expansion */
|
||||
|
||||
#include <stdlib.h> // for malloc
|
||||
#include <string.h> // for memset
|
||||
#include <stdlib.h> /* for malloc */
|
||||
#include <string.h> /* for memset */
|
||||
|
||||
static void classic_ctrl_pressed_buttons(struct classic_ctrl_t* cc, short now);
|
||||
|
||||
|
||||
@@ -53,4 +53,4 @@ void classic_ctrl_event(struct classic_ctrl_t* cc, byte* msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CLASSIC_H_INCLUDED
|
||||
#endif /* CLASSIC_H_INCLUDED */
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#define WIIMOTE_PI 3.14159265f
|
||||
|
||||
//#define WITH_WIIUSE_DEBUG
|
||||
/* #define WITH_WIIUSE_DEBUG */
|
||||
|
||||
extern FILE* logtarget[];
|
||||
|
||||
@@ -89,4 +89,4 @@ extern FILE* logtarget[];
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif // DEFINITIONS_H_INCLUDED
|
||||
#endif /* DEFINITIONS_H_INCLUDED */
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
|
||||
#include "dynamics.h"
|
||||
|
||||
#include <math.h> // for atan2f, atanf, sqrt
|
||||
#include <stdlib.h> // for abs
|
||||
#include <math.h> /* for atan2f, atanf, sqrt */
|
||||
#include <stdlib.h> /* for abs */
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,4 +57,4 @@ void apply_smoothing(struct accel_t* ac, struct orient_t* orient, int type);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DYNAMICS_H_INCLUDED
|
||||
#endif /* DYNAMICS_H_INCLUDED */
|
||||
|
||||
28
src/events.c
28
src/events.c
@@ -37,24 +37,24 @@
|
||||
#include "wiiuse_internal.h"
|
||||
#include "events.h"
|
||||
|
||||
#include "classic.h" // for classic_ctrl_disconnected, etc
|
||||
#include "dynamics.h" // for calculate_gforce, etc
|
||||
#include "guitar_hero_3.h" // for guitar_hero_3_disconnected, etc
|
||||
#include "ir.h" // for calculate_basic_ir, etc
|
||||
#include "nunchuk.h" // for nunchuk_disconnected, etc
|
||||
#include "wiiboard.h" // for wii_board_disconnected, etc
|
||||
#include "io.h" // for wiiuse_io_read on Windows, etc
|
||||
#include "classic.h" /* for classic_ctrl_disconnected, etc */
|
||||
#include "dynamics.h" /* for calculate_gforce, etc */
|
||||
#include "guitar_hero_3.h" /* for guitar_hero_3_disconnected, etc */
|
||||
#include "ir.h" /* for calculate_basic_ir, etc */
|
||||
#include "nunchuk.h" /* for nunchuk_disconnected, etc */
|
||||
#include "wiiboard.h" /* for wii_board_disconnected, etc */
|
||||
#include "io.h" /* for wiiuse_io_read on Windows, etc */
|
||||
|
||||
#ifndef WIIUSE_WIN32
|
||||
#include <sys/time.h> // for timeval
|
||||
#include <sys/select.h> // for select, fd_set
|
||||
#include <unistd.h> // for read
|
||||
#include <sys/time.h> /* for timeval */
|
||||
#include <sys/select.h> /* for select, fd_set */
|
||||
#include <unistd.h> /* for read */
|
||||
#endif
|
||||
|
||||
#include <errno.h> // for errno
|
||||
#include <stdio.h> // for printf, perror
|
||||
#include <stdlib.h> // for free, malloc
|
||||
#include <string.h> // for memcpy, memset
|
||||
#include <errno.h> /* for errno */
|
||||
#include <stdio.h> /* for printf, perror */
|
||||
#include <stdlib.h> /* for free, malloc */
|
||||
#include <string.h> /* for memcpy, memset */
|
||||
|
||||
static void idle_cycle(struct wiimote_t* wm);
|
||||
static void clear_dirty_reads(struct wiimote_t* wm);
|
||||
|
||||
@@ -56,4 +56,4 @@ void handshake_expansion(struct wiimote_t* wm, byte* data, uint16_t len);
|
||||
void disable_expansion(struct wiimote_t* wm);
|
||||
/** @} */
|
||||
|
||||
#endif // EVENTS_H_INCLUDED
|
||||
#endif /* EVENTS_H_INCLUDED */
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
|
||||
#include "guitar_hero_3.h"
|
||||
|
||||
#include "dynamics.h" // for calc_joystick_state
|
||||
#include "events.h" // for handshake_expansion
|
||||
#include "dynamics.h" /* for calc_joystick_state */
|
||||
#include "events.h" /* for handshake_expansion */
|
||||
|
||||
#include <stdlib.h> // for malloc
|
||||
#include <string.h> // for memset
|
||||
#include <stdlib.h> /* for malloc */
|
||||
#include <string.h> /* for memset */
|
||||
|
||||
static void guitar_hero_3_pressed_buttons(struct guitar_hero_3_t* gh3, short now);
|
||||
|
||||
|
||||
@@ -63,4 +63,4 @@ void guitar_hero_3_event(struct guitar_hero_3_t* gh3, byte* msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GUITAR_HERO_3_H_INCLUDED
|
||||
#endif /* GUITAR_HERO_3_H_INCLUDED */
|
||||
|
||||
2
src/io.c
2
src/io.c
@@ -32,7 +32,7 @@
|
||||
*/
|
||||
#include "io.h"
|
||||
|
||||
#include <stdlib.h> // for free, malloc
|
||||
#include <stdlib.h> /* for free, malloc */
|
||||
|
||||
|
||||
/**
|
||||
|
||||
2
src/io.h
2
src/io.h
@@ -60,4 +60,4 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CONNECT_H_INCLUDED
|
||||
#endif /* CONNECT_H_INCLUDED */
|
||||
|
||||
18
src/io_nix.c
18
src/io_nix.c
@@ -36,15 +36,15 @@
|
||||
#ifdef WIIUSE_BLUEZ
|
||||
|
||||
|
||||
#include <bluetooth/bluetooth.h> // for ba2str, str2ba
|
||||
#include <bluetooth/hci.h> // for inquiry_info
|
||||
#include <bluetooth/hci_lib.h> // for hci_get_route, hci_inquiry, etc
|
||||
#include <bluetooth/l2cap.h> // for sockaddr_l2
|
||||
#include <bluetooth/bluetooth.h> /* for ba2str, str2ba */
|
||||
#include <bluetooth/hci.h> /* for inquiry_info */
|
||||
#include <bluetooth/hci_lib.h> /* for hci_get_route, hci_inquiry, etc */
|
||||
#include <bluetooth/l2cap.h> /* for sockaddr_l2 */
|
||||
|
||||
#include <stdio.h> // for perror
|
||||
#include <string.h> // for memset
|
||||
#include <sys/socket.h> // for connect, socket
|
||||
#include <unistd.h> // for close, write
|
||||
#include <stdio.h> /* for perror */
|
||||
#include <string.h> /* for memset */
|
||||
#include <sys/socket.h> /* for connect, socket */
|
||||
#include <unistd.h> /* for close, write */
|
||||
#include <errno.h>
|
||||
|
||||
static int wiiuse_connect_single(struct wiimote_t* wm, char* address);
|
||||
@@ -76,7 +76,7 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout) {
|
||||
|
||||
/* reset all wiimote bluetooth device addresses */
|
||||
for (found_wiimotes = 0; found_wiimotes < max_wiimotes; ++found_wiimotes) {
|
||||
//bacpy(&(wm[found_wiimotes]->bdaddr), BDADDR_ANY);
|
||||
/* bacpy(&(wm[found_wiimotes]->bdaddr), BDADDR_ANY); */
|
||||
memset(&(wm[found_wiimotes]->bdaddr), 0, sizeof(bdaddr_t));
|
||||
}
|
||||
found_wiimotes = 0;
|
||||
|
||||
@@ -63,7 +63,7 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout) {
|
||||
HIDD_ATTRIBUTES attr;
|
||||
int found = 0;
|
||||
|
||||
(void) timeout; // unused
|
||||
(void) timeout; /* unused */
|
||||
|
||||
device_data.cbSize = sizeof(device_data);
|
||||
index = 0;
|
||||
|
||||
6
src/ir.c
6
src/ir.c
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "ir.h"
|
||||
|
||||
#include <math.h> // for atanf, cos, sin, sqrt
|
||||
#include <math.h> /* for atanf, cos, sin, sqrt */
|
||||
|
||||
static int get_ir_sens(struct wiimote_t* wm, const byte** block1, const byte** block2);
|
||||
static void interpret_ir_data(struct wiimote_t* wm);
|
||||
@@ -82,7 +82,7 @@ void wiiuse_set_ir(struct wiimote_t* wm, int status) {
|
||||
if(status) {
|
||||
WIIUSE_DEBUG("Tried to enable IR, will wait until handshake finishes.");
|
||||
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_IR);
|
||||
} // else ignoring request to turn off, since it's turned off by default
|
||||
} /* else ignoring request to turn off, since it's turned off by default */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ static void interpret_ir_data(struct wiimote_t* wm) {
|
||||
wm->ir.ay = wm->ir.y;
|
||||
|
||||
/* can't calculate yaw because we don't have the distance */
|
||||
//wm->orient.yaw = calc_yaw(&wm->ir);
|
||||
/* wm->orient.yaw = calc_yaw(&wm->ir); */
|
||||
|
||||
ir_convert_to_vres(&wm->ir.x, &wm->ir.y, wm->ir.aspect, wm->ir.vres[0], wm->ir.vres[1]);
|
||||
break;
|
||||
|
||||
2
src/ir.h
2
src/ir.h
@@ -56,6 +56,6 @@ float calc_yaw(struct ir_t* ir);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // IR_H_INCLUDED
|
||||
#endif /* IR_H_INCLUDED */
|
||||
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
|
||||
|
||||
#include "nunchuk.h"
|
||||
#include "dynamics.h" // for calc_joystick_state, etc
|
||||
#include "events.h" // for handshake_expansion
|
||||
#include "dynamics.h" /* for calc_joystick_state, etc */
|
||||
#include "events.h" /* for handshake_expansion */
|
||||
|
||||
#include <stdlib.h> // for malloc
|
||||
#include <string.h> // for memset
|
||||
#include <stdlib.h> /* for malloc */
|
||||
#include <string.h> /* for memset */
|
||||
|
||||
|
||||
static void nunchuk_pressed_buttons(struct nunchuk_t* nc, byte now);
|
||||
|
||||
@@ -54,4 +54,4 @@ void nunchuk_event(struct nunchuk_t* nc, byte* msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // NUNCHUK_H_INCLUDED
|
||||
#endif /* NUNCHUK_H_INCLUDED */
|
||||
|
||||
2
src/os.h
2
src/os.h
@@ -49,4 +49,4 @@
|
||||
#pragma warning(disable:4217)
|
||||
#endif
|
||||
|
||||
#endif // OS_H_INCLUDED
|
||||
#endif /* OS_H_INCLUDED */
|
||||
|
||||
@@ -40,7 +40,7 @@ void wiiuse_millisleep(int durationMilliseconds) {
|
||||
|
||||
#else /* not win32 - assuming posix */
|
||||
|
||||
#include <unistd.h> // for usleep
|
||||
#include <unistd.h> /* for usleep */
|
||||
|
||||
void wiiuse_millisleep(int durationMilliseconds) {
|
||||
usleep(durationMilliseconds * 1000);
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
#include "wiiboard.h"
|
||||
|
||||
#include <stdio.h> // for printf
|
||||
#include <string.h> // for memset
|
||||
#include <stdio.h> /* for printf */
|
||||
#include <string.h> /* for memset */
|
||||
|
||||
/**
|
||||
* @brief Handle the handshake data from the wiiboard.
|
||||
|
||||
@@ -36,11 +36,11 @@
|
||||
*/
|
||||
|
||||
#include "wiiuse_internal.h"
|
||||
#include "io.h" // for wiiuse_handshake, etc
|
||||
#include "io.h" /* for wiiuse_handshake, etc */
|
||||
|
||||
#include <stdio.h> // for printf, FILE
|
||||
#include <stdlib.h> // for malloc, free
|
||||
#include <string.h> // for memcpy, memset
|
||||
#include <stdio.h> /* for printf, FILE */
|
||||
#include <stdlib.h> /* for malloc, free */
|
||||
#include <string.h> /* for memcpy, memset */
|
||||
|
||||
static int g_banner = 0;
|
||||
static const char g_wiiuse_version_string[] = WIIUSE_VERSION;
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h> // for FILE
|
||||
#include <stdio.h> /* for FILE */
|
||||
|
||||
/** @defgroup publicapi External API */
|
||||
/** @{ */
|
||||
|
||||
@@ -389,7 +389,7 @@ WIIUSE_DECLARE_BUFFERING_OPS(uint32_t)
|
||||
|
||||
#undef WIIUSE_DECLARE_BUFFERING_OPS
|
||||
|
||||
#endif // not in doxygen
|
||||
#endif /* not in doxygen */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user