Skip to content

Commit b1ad088

Browse files
committed
Fix unused parameter warning [-Werror=unused-parameter]
1 parent edac02a commit b1ad088

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

source/c_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ BBIO_err pwm_set_duty_cycle(const char *key, float duty) {
272272
return BBIO_OK;
273273
}
274274

275-
BBIO_err pwm_setup(const char *key, float duty, float freq, int polarity)
275+
BBIO_err pwm_setup(const char *key, __attribute__ ((unused)) float duty, __attribute__ ((unused)) float freq, __attribute__ ((unused)) int polarity)
276276
{
277277
BBIO_err err;
278278
struct pwm_exp *new_pwm;

source/py_adc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ SOFTWARE.
3939
//}
4040

4141
// python function setup()
42-
static PyObject *py_setup_adc(PyObject *self, PyObject *args)
42+
static PyObject *py_setup_adc(__attribute__ ((unused)) PyObject *self, __attribute__ ((unused)) PyObject *args)
4343
{
4444
BBIO_err err;
4545

@@ -55,7 +55,7 @@ static PyObject *py_setup_adc(PyObject *self, PyObject *args)
5555
}
5656

5757
// python function read(channel)
58-
static PyObject *py_read(PyObject *self, PyObject *args)
58+
static PyObject *py_read(__attribute__ ((unused)) PyObject *self, PyObject *args)
5959
{
6060
unsigned int ain;
6161
float value;
@@ -98,7 +98,7 @@ static PyObject *py_read(PyObject *self, PyObject *args)
9898
}
9999

100100
// python function read(channel)
101-
static PyObject *py_read_raw(PyObject *self, PyObject *args)
101+
static PyObject *py_read_raw(__attribute__ ((unused)) PyObject *self, PyObject *args)
102102
{
103103
unsigned int ain;
104104
float value;

source/py_pwm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SOFTWARE.
2727
#include "c_pwm.h"
2828

2929
// python function cleanup()
30-
static PyObject *py_cleanup(PyObject *self, PyObject *args)
30+
static PyObject *py_cleanup(__attribute__ ((unused)) PyObject *self, __attribute__ ((unused)) PyObject *args)
3131
{
3232
// unexport the PWM
3333
pwm_cleanup();
@@ -36,7 +36,7 @@ static PyObject *py_cleanup(PyObject *self, PyObject *args)
3636
}
3737

3838
// python function start(channel, duty_cycle, freq)
39-
static PyObject *py_start_channel(PyObject *self, PyObject *args, PyObject *kwargs)
39+
static PyObject *py_start_channel(__attribute__ ((unused)) PyObject *self, PyObject *args, PyObject *kwargs)
4040
{
4141
char key[8];
4242
char *channel;
@@ -106,7 +106,7 @@ static PyObject *py_start_channel(PyObject *self, PyObject *args, PyObject *kwar
106106
}
107107

108108
// python function stop(channel)
109-
static PyObject *py_stop_channel(PyObject *self, PyObject *args, PyObject *kwargs)
109+
static PyObject *py_stop_channel(__attribute__ ((unused)) PyObject *self, PyObject *args, __attribute__ ((unused)) PyObject *kwargs)
110110
{
111111
char key[8];
112112
char *channel;
@@ -138,7 +138,7 @@ static PyObject *py_stop_channel(PyObject *self, PyObject *args, PyObject *kwarg
138138
}
139139

140140
// python method PWM.set_duty_cycle(channel, duty_cycle)
141-
static PyObject *py_set_duty_cycle(PyObject *self, PyObject *args, PyObject *kwargs)
141+
static PyObject *py_set_duty_cycle(__attribute__ ((unused)) PyObject *self, PyObject *args, PyObject *kwargs)
142142
{
143143
char key[8];
144144
char *channel;
@@ -172,7 +172,7 @@ static PyObject *py_set_duty_cycle(PyObject *self, PyObject *args, PyObject *kwa
172172
}
173173

174174
// python method PWM.set_frequency(channel, frequency)
175-
static PyObject *py_set_frequency(PyObject *self, PyObject *args, PyObject *kwargs)
175+
static PyObject *py_set_frequency(__attribute__ ((unused)) PyObject *self, PyObject *args, PyObject *kwargs)
176176
{
177177
char key[8];
178178
char *channel;
@@ -257,4 +257,4 @@ PyMODINIT_FUNC initPWM(void)
257257
#else
258258
return;
259259
#endif
260-
}
260+
}

source/py_uart.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SOFTWARE.
2929
const char *valid_uarts[4] = {"UART1", "UART2", "UART4", "UART5"};
3030

3131
// python function cleanup()
32-
static PyObject *py_cleanup(PyObject *self, PyObject *args)
32+
static PyObject *py_cleanup(__attribute__ ((unused)) PyObject *self, __attribute__ ((unused)) PyObject *args)
3333
{
3434
// unexport the UART
3535
uart_cleanup();
@@ -38,7 +38,7 @@ static PyObject *py_cleanup(PyObject *self, PyObject *args)
3838
}
3939

4040
// python function setup()
41-
static PyObject *py_setup_uart(PyObject *self, PyObject *args)
41+
static PyObject *py_setup_uart(__attribute__ ((unused)) PyObject *self, PyObject *args)
4242
{
4343
char dt[FILENAME_BUFFER_SIZE];
4444
char *channel;
@@ -107,4 +107,4 @@ PyMODINIT_FUNC initUART(void)
107107
#else
108108
return;
109109
#endif
110-
}
110+
}

source/spimodule.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef struct {
6060
} SPI;
6161

6262
static PyObject *
63-
SPI_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
63+
SPI_new(PyTypeObject *type, __attribute__ ((unused)) PyObject *args, __attribute__ ((unused)) PyObject *kwds)
6464
{
6565
SPI *self;
6666
if ((self = (SPI *)type->tp_alloc(type, 0)) == NULL)
@@ -380,15 +380,15 @@ static int __SPI_set_mode( int fd, __u8 mode) {
380380
}
381381

382382
static PyObject *
383-
SPI_get_mode(SPI *self, void *closure)
383+
SPI_get_mode(SPI *self, __attribute__ ((unused)) void *closure)
384384
{
385385
PyObject *result = Py_BuildValue("i", (self->mode & (SPI_CPHA | SPI_CPOL) ) );
386386

387387
return result;
388388
}
389389

390390
static PyObject *
391-
SPI_get_cshigh(SPI *self, void *closure)
391+
SPI_get_cshigh(SPI *self, __attribute__ ((unused)) void *closure)
392392
{
393393
PyObject *result;
394394

@@ -402,7 +402,7 @@ SPI_get_cshigh(SPI *self, void *closure)
402402
}
403403

404404
static PyObject *
405-
SPI_get_lsbfirst(SPI *self, void *closure)
405+
SPI_get_lsbfirst(SPI *self, __attribute__ ((unused)) void *closure)
406406
{
407407
PyObject *result;
408408

@@ -416,7 +416,7 @@ SPI_get_lsbfirst(SPI *self, void *closure)
416416
}
417417

418418
static PyObject *
419-
SPI_get_3wire(SPI *self, void *closure)
419+
SPI_get_3wire(SPI *self, __attribute__ ((unused)) void *closure)
420420
{
421421
PyObject *result;
422422

@@ -430,7 +430,7 @@ SPI_get_3wire(SPI *self, void *closure)
430430
}
431431

432432
static PyObject *
433-
SPI_get_loop(SPI *self, void *closure)
433+
SPI_get_loop(SPI *self, __attribute__ ((unused)) void *closure)
434434
{
435435
PyObject *result;
436436

@@ -445,7 +445,7 @@ SPI_get_loop(SPI *self, void *closure)
445445

446446

447447
static int
448-
SPI_set_mode(SPI *self, PyObject *val, void *closure)
448+
SPI_set_mode(SPI *self, PyObject *val, __attribute__ ((unused)) void *closure)
449449
{
450450
uint8_t mode, tmp;
451451

@@ -480,7 +480,7 @@ SPI_set_mode(SPI *self, PyObject *val, void *closure)
480480
}
481481

482482
static int
483-
SPI_set_cshigh(SPI *self, PyObject *val, void *closure)
483+
SPI_set_cshigh(SPI *self, PyObject *val, __attribute__ ((unused)) void *closure)
484484
{
485485
uint8_t tmp;
486486

@@ -508,7 +508,7 @@ SPI_set_cshigh(SPI *self, PyObject *val, void *closure)
508508
}
509509

510510
static int
511-
SPI_set_lsbfirst(SPI *self, PyObject *val, void *closure)
511+
SPI_set_lsbfirst(SPI *self, PyObject *val, __attribute__ ((unused)) void *closure)
512512
{
513513
uint8_t tmp;
514514

@@ -536,7 +536,7 @@ SPI_set_lsbfirst(SPI *self, PyObject *val, void *closure)
536536
}
537537

538538
static int
539-
SPI_set_3wire(SPI *self, PyObject *val, void *closure)
539+
SPI_set_3wire(SPI *self, PyObject *val, __attribute__ ((unused)) void *closure)
540540
{
541541
uint8_t tmp;
542542

@@ -564,7 +564,7 @@ SPI_set_3wire(SPI *self, PyObject *val, void *closure)
564564
}
565565

566566
static int
567-
SPI_set_loop(SPI *self, PyObject *val, void *closure)
567+
SPI_set_loop(SPI *self, PyObject *val, __attribute__ ((unused)) void *closure)
568568
{
569569
uint8_t tmp;
570570

@@ -592,14 +592,14 @@ SPI_set_loop(SPI *self, PyObject *val, void *closure)
592592
}
593593

594594
static PyObject *
595-
SPI_get_bpw(SPI *self, void *closure)
595+
SPI_get_bpw(SPI *self, __attribute__ ((unused)) void *closure)
596596
{
597597
PyObject *result = Py_BuildValue("i", self->bpw);
598598
return result;
599599
}
600600

601601
static int
602-
SPI_set_bpw(SPI *self, PyObject *val, void *closure)
602+
SPI_set_bpw(SPI *self, PyObject *val, __attribute__ ((unused)) void *closure)
603603
{
604604
uint8_t bits;
605605

@@ -633,14 +633,14 @@ SPI_set_bpw(SPI *self, PyObject *val, void *closure)
633633
}
634634

635635
static PyObject *
636-
SPI_get_msh(SPI *self, void *closure)
636+
SPI_get_msh(SPI *self, __attribute__ ((unused)) void *closure)
637637
{
638638
PyObject *result = Py_BuildValue("i", self->msh);
639639
return result;
640640
}
641641

642642
static int
643-
SPI_set_msh(SPI *self, PyObject *val, void *closure)
643+
SPI_set_msh(SPI *self, PyObject *val, __attribute__ ((unused)) void *closure)
644644
{
645645
uint32_t msh;
646646

0 commit comments

Comments
 (0)