Address compile warnings

This commit is contained in:
Vincent Barrilliot 2022-06-14 00:13:05 +02:00
parent 6fffde3e79
commit 88e623ff2d
7 changed files with 14 additions and 10 deletions

View file

@ -2,6 +2,7 @@
* Provide the various functions needed for the COPY command * Provide the various functions needed for the COPY command
*/ */
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -236,7 +237,7 @@ short fsys_copy_path_absolute(char * path) {
return 0; return 0;
} }
static fsys_copy_error(short screen, short n) { static void fsys_copy_error(short screen, short n) {
char line[80]; char line[80];
switch (n) { switch (n) {
case ERR_COPY_SELF: case ERR_COPY_SELF:
@ -270,7 +271,7 @@ static fsys_copy_error(short screen, short n) {
* The DOS COPY command itself: * The DOS COPY command itself:
* COPY <src path> <dst path> * COPY <src path> <dst path>
*/ */
short cmd_copy(short screen, int argc, char * argv[]) { short cmd_copy(short screen, int argc, const char * argv[]) {
char *x = 0; char *x = 0;
char *src_path = 0; char *src_path = 0;
char *src_pattern = 0; char *src_pattern = 0;

View file

@ -9,6 +9,6 @@
* The DOS COPY command itself: * The DOS COPY command itself:
* COPY <src path> <dst path> * COPY <src path> <dst path>
*/ */
extern short cmd_copy(short screen, int argc, char * argv[]); extern short cmd_copy(short screen, int argc, const char * argv[]);
#endif #endif

View file

@ -20,6 +20,7 @@
#include "log.h" #include "log.h"
#include "syscalls.h" #include "syscalls.h"
#include "simpleio.h" #include "simpleio.h"
#include "utilities.h"
#define MAX_DRIVES 8 /* Maximum number of drives */ #define MAX_DRIVES 8 /* Maximum number of drives */
#define MAX_DIRECTORIES 8 /* Maximum number of open directories */ #define MAX_DIRECTORIES 8 /* Maximum number of open directories */

View file

@ -91,7 +91,7 @@ short rtc_register_periodic(short rate, FUNC_V_2_V handler) {
*RTC_ENABLES = RTC_PIE; *RTC_ENABLES = RTC_PIE;
int_enable(INT_RTC); int_enable(INT_RTC);
} }
return 0;
} }
/* /*

View file

@ -226,7 +226,7 @@ short uart_status(p_channel chan) {
* @param mode an unused parameter * @param mode an unused parameter
* @return 0 on success, any other number is an error * @return 0 on success, any other number is an error
*/ */
short uart_open(p_channel chan, const char * spec, short mode) { short uart_open(p_channel chan, const unsigned char * spec, short mode) {
unsigned short bps = 0, lcr = 0; unsigned short bps = 0, lcr = 0;
char * saveptr; char * saveptr;
char spec_copy[80]; char spec_copy[80];
@ -391,7 +391,7 @@ short uart_read_b(p_channel chan) {
* @param size the size of the buffer. * @param size the size of the buffer.
* @return number of bytes read, any negative number is an error code * @return number of bytes read, any negative number is an error code
*/ */
short uart_read(p_channel chan, char * buffer, short size) { short uart_read(p_channel chan, unsigned char * buffer, short size) {
short i = 0, count = 0; short i = 0, count = 0;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
buffer[i] = uart_get(cdev_to_uart(chan->dev)); buffer[i] = uart_get(cdev_to_uart(chan->dev));
@ -409,7 +409,7 @@ short uart_read(p_channel chan, char * buffer, short size) {
* @param size the size of the buffer. * @param size the size of the buffer.
* @returns number of bytes read, any negative number is an error code * @returns number of bytes read, any negative number is an error code
*/ */
short uart_readline(p_channel chan, char * buffer, short size) { short uart_readline(p_channel chan, unsigned char * buffer, short size) {
short i = 0, count = 0; short i = 0, count = 0;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
char c = uart_get(cdev_to_uart(chan->dev)); char c = uart_get(cdev_to_uart(chan->dev));
@ -443,7 +443,7 @@ short uart_write_b(p_channel chan, unsigned char c) {
* @param size the size of the buffer. * @param size the size of the buffer.
* @return number of bytes written, any negative number is an error code * @return number of bytes written, any negative number is an error code
*/ */
short uart_write(p_channel chan, const char * buffer, short size) { short uart_write(p_channel chan, const unsigned char * buffer, short size) {
int i; int i;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
uart_put(cdev_to_uart(chan->dev), buffer[i]); uart_put(cdev_to_uart(chan->dev), buffer[i]);

View file

@ -61,7 +61,7 @@ typedef struct s_color4 {
* Function types * Function types
*/ */
typedef short (*FUNC_V_2_V)(); typedef void (*FUNC_V_2_V)();
typedef short (*FUNC_V_2_S)(); typedef short (*FUNC_V_2_S)();
typedef short (*FUNC_S_2_S)(char *); typedef short (*FUNC_S_2_S)(char *);
typedef short (*FUNC_BS_2_S)(unsigned char *, short); typedef short (*FUNC_BS_2_S)(unsigned char *, short);

View file

@ -4,7 +4,9 @@
* Define some handy macros and utility functions * Define some handy macros and utility functions
*/ */
#include <utilities.h> #include <ctype.h>
#include "utilities.h"
/** /**
* Re-entrant version of strtok_r, because VBCC does not provide it * Re-entrant version of strtok_r, because VBCC does not provide it