Merge branch 'Wunused-parameter' of https://github.com/lacklustrlabs/Arduino_STM32 into lacklustrlabs-Wunused-parameter
This commit is contained in:
commit
da34bb5bb3
|
@ -203,7 +203,7 @@ void adc_foreach(void (*fn)(adc_dev*)) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void adc_config_gpio(adc_dev *ignored, gpio_dev *gdev, uint8 bit) {
|
void adc_config_gpio(adc_dev *ignored __attribute__((unused)), gpio_dev *gdev, uint8 bit) {
|
||||||
gpio_set_mode(gdev, bit, GPIO_INPUT_ANALOG);
|
gpio_set_mode(gdev, bit, GPIO_INPUT_ANALOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ spi_dev *SPI3 = &spi3;
|
||||||
* Routines
|
* Routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void spi_config_gpios(spi_dev *ignored,
|
void spi_config_gpios(spi_dev *ignored __attribute__((unused)),
|
||||||
uint8 as_master,
|
uint8 as_master,
|
||||||
gpio_dev *nss_dev,
|
gpio_dev *nss_dev,
|
||||||
uint8 nss_bit,
|
uint8 nss_bit,
|
||||||
|
|
|
@ -327,7 +327,7 @@ static void output_compare_mode(timer_dev *dev, uint8 channel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//added by CARLOS.
|
//added by CARLOS.
|
||||||
static void encoder_mode(timer_dev *dev, uint8 channel) {
|
static void encoder_mode(timer_dev *dev, uint8 channel __attribute__((unused))) {
|
||||||
|
|
||||||
//prescaler.
|
//prescaler.
|
||||||
//(dev->regs).gen->PSC = 1;
|
//(dev->regs).gen->PSC = 1;
|
||||||
|
|
|
@ -88,7 +88,7 @@ void _fail(const char* file, int line, const char* exp) {
|
||||||
* Provide an __assert_func handler to libc so that calls to assert()
|
* Provide an __assert_func handler to libc so that calls to assert()
|
||||||
* get redirected to _fail.
|
* get redirected to _fail.
|
||||||
*/
|
*/
|
||||||
void __assert_func(const char* file, int line, const char* method,
|
void __assert_func(const char* file, int line, const char* method __attribute__((unused)),
|
||||||
const char* expression) {
|
const char* expression) {
|
||||||
_fail(file, line, expression);
|
_fail(file, line, expression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,7 +236,7 @@ enum reset_state_t {
|
||||||
|
|
||||||
static reset_state_t reset_state = DTR_UNSET;
|
static reset_state_t reset_state = DTR_UNSET;
|
||||||
|
|
||||||
static void ifaceSetupHook(unsigned hook, void *requestvp) {
|
static void ifaceSetupHook(unsigned hook __attribute__((unused)), void *requestvp) {
|
||||||
uint8 request = *(uint8*)requestvp;
|
uint8 request = *(uint8*)requestvp;
|
||||||
|
|
||||||
// Ignore requests we're not interested in.
|
// Ignore requests we're not interested in.
|
||||||
|
@ -290,7 +290,7 @@ static void wait_reset(void) {
|
||||||
#define STACK_TOP 0x20000800
|
#define STACK_TOP 0x20000800
|
||||||
#define EXC_RETURN 0xFFFFFFF9
|
#define EXC_RETURN 0xFFFFFFF9
|
||||||
#define DEFAULT_CPSR 0x61000000
|
#define DEFAULT_CPSR 0x61000000
|
||||||
static void rxHook(unsigned hook, void *ignored) {
|
static void rxHook(unsigned hook __attribute__((unused)), void *ignored __attribute__((unused))) {
|
||||||
/* FIXME this is mad buggy; we need a new reset sequence. E.g. NAK
|
/* FIXME this is mad buggy; we need a new reset sequence. E.g. NAK
|
||||||
* after each RX means you can't reset if any bytes are waiting. */
|
* after each RX means you can't reset if any bytes are waiting. */
|
||||||
if (reset_state == DTR_NEGEDGE) {
|
if (reset_state == DTR_NEGEDGE) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ extern i2c_dev* const I2C2;
|
||||||
* For internal use
|
* For internal use
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline uint32 _i2c_bus_clk(i2c_dev *dev) {
|
static inline uint32 _i2c_bus_clk(i2c_dev *dev __attribute__((unused))) {
|
||||||
/* Both I2C peripherals are on APB1 */
|
/* Both I2C peripherals are on APB1 */
|
||||||
return STM32_PCLK1 / (1000 * 1000);
|
return STM32_PCLK1 / (1000 * 1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,15 +76,15 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ __weak int isatty(int fd) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,28 +76,28 @@ void *_sbrk(int incr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _open(const char *path, int flags, ...) {
|
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _close(int fd) {
|
__weak int _close(int fd __attribute__((unused))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _fstat(int fd, struct stat *st) {
|
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
|
||||||
st->st_mode = S_IFCHR;
|
st->st_mode = S_IFCHR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _isatty(int fd) {
|
__weak int _isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int isatty(int fd) {
|
__weak int isatty(int fd __attribute__((unused))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _lseek(int fd, off_t pos, int whence) {
|
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,13 +106,13 @@ __weak unsigned char getch(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__weak int _read(int fd, char *buf, size_t cnt) {
|
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
|
||||||
*buf = getch();
|
*buf = getch();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void putch(unsigned char c) {
|
__weak void putch(unsigned char c __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void cgets(char *s, int bufsize) {
|
__weak void cgets(char *s, int bufsize) {
|
||||||
|
@ -155,7 +155,7 @@ __weak void cgets(char *s, int bufsize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak int _write(int fd, const char *buf, size_t cnt) {
|
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
|
@ -165,12 +165,12 @@ __weak int _write(int fd, const char *buf, size_t cnt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override fgets() in newlib with a version that does line editing */
|
/* Override fgets() in newlib with a version that does line editing */
|
||||||
__weak char *fgets(char *s, int bufsize, void *f) {
|
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
|
||||||
cgets(s, bufsize);
|
cgets(s, bufsize);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void _exit(int exitcode) {
|
__weak void _exit(int exitcode __attribute__((unused))) {
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue