From 8fe1c3925c3bd6e798cb3c8ac674804086b78e6d Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 29 Dec 2006 05:41:10 +0000 Subject: made devicename kludge more readable svn path=/trunk/externals/iem/comport/; revision=7098 --- comport/comport.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'comport') diff --git a/comport/comport.c b/comport/comport.c index c5fa729..e326912 100644 --- a/comport/comport.c +++ b/comport/comport.c @@ -92,6 +92,7 @@ typedef struct comport #define TXBUFOVERRUN -5 #define COMPORT_MAX 99 +#define USE_DEVICENAME 9999 /* use the device name instead of the number */ #ifdef _WIN32 /* we don't use the table for windos cos we can set the number directly. */ @@ -762,8 +763,8 @@ static int open_serial(unsigned int com_num, t_comport *x) float *baud = &(x->baud); glob_t glob_buffer; - /* if com_num == 9999, use device name directly, else try port # */ - if(com_num != 9999) + /* if com_num == USE_DEVICENAME, use device name directly, else try port # */ + if(com_num != USE_DEVICENAME) { if(com_num >= COMPORT_MAX) { @@ -1269,7 +1270,7 @@ static void comport_open(t_comport *x, t_floatarg f) static void comport_devicename(t_comport *x, t_symbol *s) { x->serial_device = s; - x->comhandle = open_serial(9999,x); + x->comhandle = open_serial(USE_DEVICENAME,x); clock_delay(x->x_clock, x->x_deltime); } -- cgit v1.2.1