@@ -101,7 +101,7 @@ double tt565_timenow() /* returns current time in secs+microsecs */
101101 *
102102 * This is the basic I/O transaction to/from the Orion.
103103 * \n Read variable number of bytes, up to buffer size, if data & data_len != NULL.
104- * \n We assume that rig!=NULL, rig->state != NULL.
104+ * \n We assume that rig!=NULL, STATE( rig) != NULL.
105105 * Otherwise, you'll get a nice seg fault. You've been warned!
106106 */
107107
@@ -221,12 +221,12 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
221221int tt565_init (RIG * rig )
222222{
223223 struct tt565_priv_data * priv ;
224- rig -> state . priv = (struct tt565_priv_data * )calloc (1 , sizeof (
224+ STATE ( rig ) -> priv = (struct tt565_priv_data * )calloc (1 , sizeof (
225225 struct tt565_priv_data ));
226226
227- if (!rig -> state . priv ) { return - RIG_ENOMEM ; } /* no memory available */
227+ if (!STATE ( rig ) -> priv ) { return - RIG_ENOMEM ; } /* no memory available */
228228
229- priv = rig -> state . priv ;
229+ priv = STATE ( rig ) -> priv ;
230230
231231 memset (priv , 0 , sizeof (struct tt565_priv_data ));
232232 priv -> ch = 0 ; /* set arbitrary initial status */
@@ -242,12 +242,12 @@ int tt565_init(RIG *rig)
242242 */
243243int tt565_cleanup (RIG * rig )
244244{
245- if (rig -> state . priv )
245+ if (STATE ( rig ) -> priv )
246246 {
247- free (rig -> state . priv );
247+ free (STATE ( rig ) -> priv );
248248 }
249249
250- rig -> state . priv = NULL ;
250+ STATE ( rig ) -> priv = NULL ;
251251
252252 return RIG_OK ;
253253}
@@ -274,11 +274,11 @@ int tt565_open(RIG *rig)
274274 if (!strstr (buf , "1." ))
275275 {
276276 /* Not v1 means probably v2 */
277- memcpy (& rig -> state . str_cal , & cal2 , sizeof (cal_table_t ));
277+ memcpy (& STATE ( rig ) -> str_cal , & cal2 , sizeof (cal_table_t ));
278278 }
279279 else
280280 {
281- memcpy (& rig -> state . str_cal , & cal1 , sizeof (cal_table_t ));
281+ memcpy (& STATE ( rig ) -> str_cal , & cal1 , sizeof (cal_table_t ));
282282 }
283283
284284 return RIG_OK ;
@@ -296,7 +296,7 @@ int tt565_open(RIG *rig)
296296 */
297297static char which_receiver (const RIG * rig , vfo_t vfo )
298298{
299- const struct tt565_priv_data * priv = (struct tt565_priv_data * )rig -> state . priv ;
299+ const struct tt565_priv_data * priv = (struct tt565_priv_data * )STATE ( rig ) -> priv ;
300300
301301 if (vfo == RIG_VFO_CURR )
302302 {
@@ -325,7 +325,7 @@ static char which_receiver(const RIG *rig, vfo_t vfo)
325325 */
326326static char which_vfo (const RIG * rig , vfo_t vfo )
327327{
328- const struct tt565_priv_data * priv = (struct tt565_priv_data * )rig -> state . priv ;
328+ const struct tt565_priv_data * priv = (struct tt565_priv_data * )STATE ( rig ) -> priv ;
329329
330330 if (vfo == RIG_VFO_CURR )
331331 {
@@ -353,7 +353,7 @@ static char which_vfo(const RIG *rig, vfo_t vfo)
353353 * \param freq
354354 * \brief Set a frequence into the specified VFO
355355 *
356- * assumes rig->state. priv!=NULL
356+ * assumes STATE( rig)-> priv!=NULL
357357 * \n assumes priv->mode in AM,CW,LSB or USB.
358358 */
359359
@@ -373,7 +373,7 @@ int tt565_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
373373
374374 for (i = 0 ; i < HAMLIB_FRQRANGESIZ ; i ++ )
375375 {
376- this_range = rig -> state . rx_range_list [i ];
376+ this_range = STATE ( rig ) -> rx_range_list [i ];
377377
378378 if (this_range .startf == 0 && this_range .endf == 0 )
379379 {
@@ -382,7 +382,7 @@ int tt565_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
382382
383383 /* We don't care about mode setting, but vfo must match. */
384384 if (freq >= this_range .startf && freq <= this_range .endf &&
385- (this_range .vfo == rig -> state . current_vfo ))
385+ (this_range .vfo == STATE ( rig ) -> current_vfo ))
386386 {
387387 in_range = TRUE;
388388 break ;
@@ -481,7 +481,7 @@ int tt565_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
481481 */
482482int tt565_set_vfo (RIG * rig , vfo_t vfo )
483483{
484- struct tt565_priv_data * priv = (struct tt565_priv_data * )rig -> state . priv ;
484+ struct tt565_priv_data * priv = (struct tt565_priv_data * )STATE ( rig ) -> priv ;
485485
486486 if (vfo == RIG_VFO_CURR )
487487 {
@@ -510,7 +510,7 @@ int tt565_set_vfo(RIG *rig, vfo_t vfo)
510510 */
511511int tt565_get_vfo (RIG * rig , vfo_t * vfo )
512512{
513- const struct tt565_priv_data * priv = (struct tt565_priv_data * )rig -> state . priv ;
513+ const struct tt565_priv_data * priv = (struct tt565_priv_data * )STATE ( rig ) -> priv ;
514514
515515 * vfo = priv -> vfo_curr ;
516516
@@ -1783,7 +1783,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
17831783 */
17841784int tt565_set_mem (RIG * rig , vfo_t vfo , int ch )
17851785{
1786- struct tt565_priv_data * priv = (struct tt565_priv_data * )rig -> state . priv ;
1786+ struct tt565_priv_data * priv = (struct tt565_priv_data * )STATE ( rig ) -> priv ;
17871787
17881788 priv -> ch = ch ; /* See RIG_OP_TO/FROM_VFO */
17891789 return RIG_OK ;
@@ -1798,7 +1798,7 @@ int tt565_set_mem(RIG *rig, vfo_t vfo, int ch)
17981798 */
17991799int tt565_get_mem (RIG * rig , vfo_t vfo , int * ch )
18001800{
1801- const struct tt565_priv_data * priv = (struct tt565_priv_data * )rig -> state . priv ;
1801+ const struct tt565_priv_data * priv = (struct tt565_priv_data * )STATE ( rig ) -> priv ;
18021802
18031803 * ch = priv -> ch ;
18041804 return RIG_OK ;
@@ -1820,7 +1820,7 @@ int tt565_get_mem(RIG *rig, vfo_t vfo, int *ch)
18201820 */
18211821int tt565_vfo_op (RIG * rig , vfo_t vfo , vfo_op_t op )
18221822{
1823- const struct tt565_priv_data * priv = (struct tt565_priv_data * )rig -> state . priv ;
1823+ const struct tt565_priv_data * priv = (struct tt565_priv_data * )STATE ( rig ) -> priv ;
18241824 char cmdbuf [TT565_BUFSIZE ];
18251825 int retval ;
18261826
0 commit comments