Skip to content

Commit

Permalink
chg: Code refactor - remove g++ warnings !minor
Browse files Browse the repository at this point in the history
  • Loading branch information
lcgamboa committed Jan 11, 2024
1 parent c02a9f6 commit 9155434
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/boards/board_RemoteTCP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ void cboard_RemoteTCP::EvThreadRun(CThread& thread) {
}

dprintf("MSG type = %i size=%i timestamp= %lu ", cmd_header.msg_type, cmd_header.payload_size,
cmd_header.time);
(long unsigned int)cmd_header.time);

switch (cmd_header.msg_type) {
case VB_PINFO: {
Expand Down Expand Up @@ -957,7 +957,7 @@ void cboard_RemoteTCP::EvThreadRun(CThread& thread) {
ConnectionError("send_cmd");
break;
}
dprintf("VB_PREAD reg[%x] = %x \n", addr, ntohl(payload[1]));
dprintf("VB_PREAD reg[%x] = %x \n", addr, (unsigned int)ntohl(payload[1]));
} break;
case VB_QUIT:
send_cmd(VB_QUIT);
Expand Down
9 changes: 3 additions & 6 deletions src/devices/sdcard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static unsigned char buff[512];

unsigned short sdcard_io(sdcard_t* sd, unsigned char mosi, unsigned char clk, unsigned char ss) {
unsigned int offset = 0;
unsigned short crc16;
unsigned short crc16 = 0;

if (!sd->card_present) {
return 1;
Expand Down Expand Up @@ -592,10 +592,7 @@ void sdcard_set_filename(sdcard_t* sd, const char* fname) {
sd->card_present = 1;

sd->disk_size = sb.st_size >> 10;
#ifdef _WIN_
dprintf("sdcard size=%li kb -> %lli blocks\n", sd->disk_size, sb.st_size / 512);
#else
dprintf("sdcard size=%li kb -> %li blocks\n", sd->disk_size, sb.st_size / 512);
#endif

dprintf("sdcard size=%li kb -> %li blocks\n", sd->disk_size, (long)(sb.st_size / 512));
}
}
3 changes: 2 additions & 1 deletion src/devices/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
#ifndef UART
#define UART

#include "bitbang_uart.h"

#include <stdio.h>
#include "../lib/serial_port.h"
#include "bitbang_uart.h"

typedef struct {
unsigned char connected;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/rcontrol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
#include <sys/un.h>
#include <sys/unistd.h>
#else
#include <winsock.h>
#include <winsock2.h>
#ifndef MSG_WAITALL
#define MSG_WAITALL (1 << 3)
#define MSG_NOSIGNAL 0
#endif
#define MSG_NOSIGNAL 0
#endif
// system headers independent
#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion src/parts/input_ADXL345.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class cpart_ADXL345 : public part {
lxFont font_p;
unsigned char active[3];
double asens;
double gsens;
// double gsens;
unsigned char ret_;
};

Expand Down
2 changes: 1 addition & 1 deletion src/picsimlab1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void CPWindow1::timer2_EvOnTime(CControl* control) {
#ifndef __EMSCRIPTEN__
Message_sz(lxString::FromUTF8(PICSimLab.GetError(0)), 600, 240);
#else
printf("Error: %s\n", PICSimLab.GetError(0)._str());
printf("Error: %s\n", PICSimLab.GetError(0).c_str());
#endif
PICSimLab.DeleteError(0);
}
Expand Down

0 comments on commit 9155434

Please sign in to comment.