Skip to content

Commit 4a0a94f

Browse files
committed
Replace ancient K&R function declarations by ANSI style
1 parent 1786efd commit 4a0a94f

File tree

3 files changed

+70
-149
lines changed

3 files changed

+70
-149
lines changed

ext/native/posix_serialport_impl.c

+18-40
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ int get_fd_helper(VALUE io)
7272
#endif
7373
}
7474

75-
VALUE sp_create_impl(class, _port)
76-
VALUE class, _port;
75+
VALUE sp_create_impl(VALUE class, VALUE _port)
7776
{
7877
int fd;
7978
int num_port;
@@ -157,9 +156,7 @@ VALUE sp_create_impl(class, _port)
157156
return sp;
158157
}
159158

160-
VALUE sp_set_modem_params_impl(argc, argv, self)
161-
int argc;
162-
VALUE *argv, self;
159+
VALUE sp_set_modem_params_impl(int argc, VALUE *argv, VALUE self)
163160
{
164161
int fd;
165162
struct termios params;
@@ -380,9 +377,7 @@ VALUE sp_set_modem_params_impl(argc, argv, self)
380377
return argv[0];
381378
}
382379

383-
void get_modem_params_impl(self, mp)
384-
VALUE self;
385-
struct modem_params *mp;
380+
void get_modem_params_impl(VALUE self, struct modem_params *mp)
386381
{
387382
int fd;
388383
struct termios params;
@@ -474,8 +469,7 @@ void get_modem_params_impl(self, mp)
474469
}
475470
}
476471

477-
VALUE sp_set_flow_control_impl(self, val)
478-
VALUE self, val;
472+
VALUE sp_set_flow_control_impl(VALUE self, VALUE val)
479473
{
480474
int fd;
481475
int flowc;
@@ -521,8 +515,7 @@ VALUE sp_set_flow_control_impl(self, val)
521515
return val;
522516
}
523517

524-
VALUE sp_get_flow_control_impl(self)
525-
VALUE self;
518+
VALUE sp_get_flow_control_impl(VALUE self)
526519
{
527520
int ret;
528521
int fd;
@@ -551,8 +544,7 @@ VALUE sp_get_flow_control_impl(self)
551544
return INT2FIX(ret);
552545
}
553546

554-
VALUE sp_set_read_timeout_impl(self, val)
555-
VALUE self, val;
547+
VALUE sp_set_read_timeout_impl(VALUE self, VALUE val)
556548
{
557549
int timeout;
558550
int fd;
@@ -591,8 +583,7 @@ VALUE sp_set_read_timeout_impl(self, val)
591583
return val;
592584
}
593585

594-
VALUE sp_get_read_timeout_impl(self)
595-
VALUE self;
586+
VALUE sp_get_read_timeout_impl(VALUE self)
596587
{
597588
int fd;
598589
struct termios params;
@@ -611,22 +602,19 @@ VALUE sp_get_read_timeout_impl(self)
611602
return INT2FIX(params.c_cc[VTIME] * 100);
612603
}
613604

614-
VALUE sp_set_write_timeout_impl(self, val)
615-
VALUE self, val;
605+
VALUE sp_set_write_timeout_impl(VALUE self, VALUE val)
616606
{
617607
rb_notimplement();
618608
return self;
619609
}
620610

621-
VALUE sp_get_write_timeout_impl(self)
622-
VALUE self;
611+
VALUE sp_get_write_timeout_impl(VALUE self)
623612
{
624613
rb_notimplement();
625614
return self;
626615
}
627616

628-
VALUE sp_break_impl(self, time)
629-
VALUE self, time;
617+
VALUE sp_break_impl(VALUE self, VALUE time)
630618
{
631619
int fd;
632620

@@ -642,9 +630,7 @@ VALUE sp_break_impl(self, time)
642630
return Qnil;
643631
}
644632

645-
void get_line_signals_helper_impl(obj, ls)
646-
VALUE obj;
647-
struct line_signals *ls;
633+
void get_line_signals_helper_impl(VALUE obj, struct line_signals *ls)
648634
{
649635
int fd, status;
650636

@@ -663,9 +649,7 @@ void get_line_signals_helper_impl(obj, ls)
663649
ls->ri = (status & TIOCM_RI ? 1 : 0);
664650
}
665651

666-
VALUE set_signal_impl(obj, val, sig)
667-
VALUE obj,val;
668-
int sig;
652+
VALUE set_signal_impl(VALUE obj, VALUE val, int sig)
669653
{
670654
int status;
671655
int fd;
@@ -702,29 +686,25 @@ VALUE set_signal_impl(obj, val, sig)
702686
return val;
703687
}
704688

705-
VALUE sp_set_rts_impl(self, val)
706-
VALUE self, val;
689+
VALUE sp_set_rts_impl(VALUE self, VALUE val)
707690
{
708691
return set_signal_impl(self, val, TIOCM_RTS);
709692
}
710693

711-
VALUE sp_set_dtr_impl(self, val)
712-
VALUE self, val;
694+
VALUE sp_set_dtr_impl(VALUE self, VALUE val)
713695
{
714696
return set_signal_impl(self, val, TIOCM_DTR);
715697
}
716698

717-
VALUE sp_get_rts_impl(self)
718-
VALUE self;
699+
VALUE sp_get_rts_impl(VALUE self)
719700
{
720701
struct line_signals ls;
721702

722703
get_line_signals_helper_impl(self, &ls);
723704
return INT2FIX(ls.rts);
724705
}
725706

726-
VALUE sp_get_dtr_impl(self)
727-
VALUE self;
707+
VALUE sp_get_dtr_impl(VALUE self)
728708
{
729709
struct line_signals ls;
730710

@@ -733,8 +713,7 @@ VALUE sp_get_dtr_impl(self)
733713
return INT2FIX(ls.dtr);
734714
}
735715

736-
VALUE sp_flush_input_data_impl(self)
737-
VALUE self;
716+
VALUE sp_flush_input_data_impl(VALUE self)
738717
{
739718
int fd;
740719
int ret;
@@ -749,8 +728,7 @@ VALUE self;
749728
return Qtrue;
750729
}
751730

752-
VALUE sp_flush_output_data_impl(self)
753-
VALUE self;
731+
VALUE sp_flush_output_data_impl(VALUE self)
754732
{
755733
int fd;
756734
int ret;

0 commit comments

Comments
 (0)