@@ -140,7 +140,7 @@ MessageAide: DB "H",0Dh,0Ah
140140
141141static void prm80_force_cache_timeout (RIG * rig )
142142{
143- struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
143+ struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
144144
145145 rig_force_cache_timeout (& priv -> status_tv );
146146}
@@ -283,9 +283,9 @@ int prm80_init(RIG *rig)
283283 return - RIG_EINVAL ;
284284 }
285285
286- rig -> state . priv = (void * )calloc (1 , sizeof (struct prm80_priv_data ));
286+ STATE ( rig ) -> priv = (void * )calloc (1 , sizeof (struct prm80_priv_data ));
287287
288- if (!rig -> state . priv )
288+ if (!STATE ( rig ) -> priv )
289289 {
290290 /* whoops! memory shortage! */
291291 return - RIG_ENOMEM ;
@@ -301,8 +301,8 @@ int prm80_cleanup(RIG *rig)
301301 return - RIG_EINVAL ;
302302 }
303303
304- free (rig -> state . priv );
305- rig -> state . priv = NULL ;
304+ free (STATE ( rig ) -> priv );
305+ STATE ( rig ) -> priv = NULL ;
306306
307307 return RIG_OK ;
308308}
@@ -418,7 +418,7 @@ int prm80_set_rx_tx_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq)
418418 */
419419int prm80_set_freq (RIG * rig , vfo_t vfo , freq_t freq )
420420{
421- struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
421+ struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
422422 freq_t tx_freq ;
423423 int rc ;
424424
@@ -448,7 +448,7 @@ int prm80_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
448448 */
449449int prm80_set_split_freq (RIG * rig , vfo_t vfo , freq_t tx_freq )
450450{
451- struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
451+ struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
452452 freq_t rx_freq ;
453453 int rc ;
454454
@@ -471,7 +471,7 @@ int prm80_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
471471 */
472472int prm80_get_freq (RIG * rig , vfo_t vfo , freq_t * freq )
473473{
474- struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
474+ struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
475475 int ret ;
476476 channel_t chan ;
477477
@@ -498,7 +498,7 @@ int prm80_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
498498 */
499499int prm80_set_split_vfo (RIG * rig , vfo_t vfo , split_t split , vfo_t tx_vfo )
500500{
501- struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
501+ struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
502502
503503 priv -> split = split ;
504504
@@ -510,7 +510,7 @@ int prm80_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
510510 */
511511int prm80_get_split_vfo (RIG * rig , vfo_t vfo , split_t * split , vfo_t * tx_vfo )
512512{
513- const struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
513+ const struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
514514
515515 * split = priv -> split ;
516516 * tx_vfo = RIG_VFO_CURR ;
@@ -523,7 +523,7 @@ int prm80_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
523523 */
524524int prm80_get_split_freq (RIG * rig , vfo_t vfo , freq_t * tx_freq )
525525{
526- struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
526+ struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
527527 int ret ;
528528 channel_t chan ;
529529
@@ -694,7 +694,7 @@ static int prm80_do_read_system_state(hamlib_port_t *rigport, char *statebuf)
694694 */
695695static int prm80_read_system_state (RIG * rig , char * statebuf )
696696{
697- struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
697+ struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
698698 int ret = RIG_OK ;
699699
700700 if (rig_check_cache_timeout (& priv -> status_tv , PRM80_CACHE_TIMEOUT ))
@@ -723,7 +723,7 @@ static int prm80_read_system_state(RIG *rig, char *statebuf)
723723 */
724724int prm80_get_channel (RIG * rig , vfo_t vfo , channel_t * chan , int read_only )
725725{
726- const struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
726+ const struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
727727 char statebuf [BUFSZ ];
728728 int ret , chanstate , mode_byte , lock_byte ;
729729
@@ -821,7 +821,7 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
821821 */
822822int prm80_set_channel (RIG * rig , vfo_t vfo , const channel_t * chan )
823823{
824- struct prm80_priv_data * priv = (struct prm80_priv_data * )rig -> state . priv ;
824+ struct prm80_priv_data * priv = (struct prm80_priv_data * )STATE ( rig ) -> priv ;
825825 hamlib_port_t * rp = RIGPORT (rig );
826826 char buf [BUFSZ ];
827827 int ret , chanstate ;
@@ -1107,7 +1107,7 @@ int prm80_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
11071107static int prm80_get_rawstr_RAM (RIG * rig , value_t * val )
11081108{
11091109 char buf [BUFSZ ];
1110- struct rig_state * rs = & rig -> state ;
1110+ struct rig_state * rs = STATE ( rig ) ;
11111111 hamlib_port_t * rp = RIGPORT (rig );
11121112 int ret , i ;
11131113
0 commit comments