@@ -600,73 +600,77 @@ OM_uint32 gpm_release_buffer(OM_uint32 *minor_status,
600
600
return GSS_S_COMPLETE ;
601
601
}
602
602
603
+ /* Equivalent to xdrptoc_t but with proper arguments so that modern
604
+ * compilers do not complain */
605
+ typedef int xdrfn (XDR * , void * );
606
+
603
607
struct gpm_rpc_fn_set {
604
- xdrproc_t arg_fn ;
605
- xdrproc_t res_fn ;
608
+ xdrfn * arg_fn ;
609
+ xdrfn * res_fn ;
606
610
} gpm_xdr_set [] = {
607
611
{ /* NULLPROC */
608
- (xdrproc_t )xdr_void ,
609
- (xdrproc_t )xdr_void ,
612
+ (xdrfn * )xdr_void ,
613
+ (xdrfn * )xdr_void ,
610
614
},
611
615
{ /* GSSX_INDICATE_MECHS */
612
- (xdrproc_t )xdr_gssx_arg_indicate_mechs ,
613
- (xdrproc_t )xdr_gssx_res_indicate_mechs ,
616
+ (xdrfn * )xdr_gssx_arg_indicate_mechs ,
617
+ (xdrfn * )xdr_gssx_res_indicate_mechs ,
614
618
},
615
619
{ /* GSSX_GET_CALL_CONTEXT */
616
- (xdrproc_t )xdr_gssx_arg_get_call_context ,
617
- (xdrproc_t )xdr_gssx_res_get_call_context ,
620
+ (xdrfn * )xdr_gssx_arg_get_call_context ,
621
+ (xdrfn * )xdr_gssx_res_get_call_context ,
618
622
},
619
623
{ /* GSSX_IMPORT_AND_CANON_NAME */
620
- (xdrproc_t )xdr_gssx_arg_import_and_canon_name ,
621
- (xdrproc_t )xdr_gssx_res_import_and_canon_name ,
624
+ (xdrfn * )xdr_gssx_arg_import_and_canon_name ,
625
+ (xdrfn * )xdr_gssx_res_import_and_canon_name ,
622
626
},
623
627
{ /* GSSX_EXPORT_CRED */
624
- (xdrproc_t )xdr_gssx_arg_export_cred ,
625
- (xdrproc_t )xdr_gssx_res_export_cred ,
628
+ (xdrfn * )xdr_gssx_arg_export_cred ,
629
+ (xdrfn * )xdr_gssx_res_export_cred ,
626
630
},
627
631
{ /* GSSX_IMPORT_CRED */
628
- (xdrproc_t )xdr_gssx_arg_import_cred ,
629
- (xdrproc_t )xdr_gssx_res_import_cred ,
632
+ (xdrfn * )xdr_gssx_arg_import_cred ,
633
+ (xdrfn * )xdr_gssx_res_import_cred ,
630
634
},
631
635
{ /* GSSX_ACQUIRE_CRED */
632
- (xdrproc_t )xdr_gssx_arg_acquire_cred ,
633
- (xdrproc_t )xdr_gssx_res_acquire_cred ,
636
+ (xdrfn * )xdr_gssx_arg_acquire_cred ,
637
+ (xdrfn * )xdr_gssx_res_acquire_cred ,
634
638
},
635
639
{ /* GSSX_STORE_CRED */
636
- (xdrproc_t )xdr_gssx_arg_store_cred ,
637
- (xdrproc_t )xdr_gssx_res_store_cred ,
640
+ (xdrfn * )xdr_gssx_arg_store_cred ,
641
+ (xdrfn * )xdr_gssx_res_store_cred ,
638
642
},
639
643
{ /* GSSX_INIT_SEC_CONTEXT */
640
- (xdrproc_t )xdr_gssx_arg_init_sec_context ,
641
- (xdrproc_t )xdr_gssx_res_init_sec_context ,
644
+ (xdrfn * )xdr_gssx_arg_init_sec_context ,
645
+ (xdrfn * )xdr_gssx_res_init_sec_context ,
642
646
},
643
647
{ /* GSSX_ACCEPT_SEC_CONTEXT */
644
- (xdrproc_t )xdr_gssx_arg_accept_sec_context ,
645
- (xdrproc_t )xdr_gssx_res_accept_sec_context ,
648
+ (xdrfn * )xdr_gssx_arg_accept_sec_context ,
649
+ (xdrfn * )xdr_gssx_res_accept_sec_context ,
646
650
},
647
651
{ /* GSSX_RELEASE_HANDLE */
648
- (xdrproc_t )xdr_gssx_arg_release_handle ,
649
- (xdrproc_t )xdr_gssx_res_release_handle ,
652
+ (xdrfn * )xdr_gssx_arg_release_handle ,
653
+ (xdrfn * )xdr_gssx_res_release_handle ,
650
654
},
651
655
{ /* GSSX_GET_MIC */
652
- (xdrproc_t )xdr_gssx_arg_get_mic ,
653
- (xdrproc_t )xdr_gssx_res_get_mic ,
656
+ (xdrfn * )xdr_gssx_arg_get_mic ,
657
+ (xdrfn * )xdr_gssx_res_get_mic ,
654
658
},
655
659
{ /* GSSX_VERIFY */
656
- (xdrproc_t )xdr_gssx_arg_verify_mic ,
657
- (xdrproc_t )xdr_gssx_res_verify_mic ,
660
+ (xdrfn * )xdr_gssx_arg_verify_mic ,
661
+ (xdrfn * )xdr_gssx_res_verify_mic ,
658
662
},
659
663
{ /* GSSX_WRAP */
660
- (xdrproc_t )xdr_gssx_arg_wrap ,
661
- (xdrproc_t )xdr_gssx_res_wrap ,
664
+ (xdrfn * )xdr_gssx_arg_wrap ,
665
+ (xdrfn * )xdr_gssx_res_wrap ,
662
666
},
663
667
{ /* GSSX_UNWRAP */
664
- (xdrproc_t )xdr_gssx_arg_unwrap ,
665
- (xdrproc_t )xdr_gssx_res_unwrap ,
668
+ (xdrfn * )xdr_gssx_arg_unwrap ,
669
+ (xdrfn * )xdr_gssx_res_unwrap ,
666
670
},
667
671
{ /* GSSX_WRAP_SIZE_LIMIT */
668
- (xdrproc_t )xdr_gssx_arg_wrap_size_limit ,
669
- (xdrproc_t )xdr_gssx_res_wrap_size_limit ,
672
+ (xdrfn * )xdr_gssx_arg_wrap_size_limit ,
673
+ (xdrfn * )xdr_gssx_res_wrap_size_limit ,
670
674
}
671
675
};
672
676
@@ -676,6 +680,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union gp_rpc_res *res)
676
680
gp_rpc_msg msg ;
677
681
XDR xdr_call_ctx = {0 };
678
682
XDR xdr_reply_ctx = {0 };
683
+ xdrfn * arg_fn ;
684
+ xdrfn * res_fn ;
679
685
char * send_buffer = NULL ;
680
686
char * recv_buffer = NULL ;
681
687
uint32_t send_length ;
@@ -726,7 +732,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union gp_rpc_res *res)
726
732
}
727
733
728
734
/* encode data */
729
- xdrok = gpm_xdr_set [proc ].arg_fn (& xdr_call_ctx , (char * )arg );
735
+ arg_fn = gpm_xdr_set [proc ].arg_fn ;
736
+ xdrok = arg_fn (& xdr_call_ctx , arg );
730
737
if (!xdrok ) {
731
738
ret = EINVAL ;
732
739
goto done ;
@@ -765,7 +772,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union gp_rpc_res *res)
765
772
}
766
773
767
774
/* decode answer */
768
- xdrok = gpm_xdr_set [proc ].res_fn (& xdr_reply_ctx , (char * )res );
775
+ res_fn = gpm_xdr_set [proc ].res_fn ;
776
+ xdrok = res_fn (& xdr_reply_ctx , res );
769
777
if (!xdrok ) {
770
778
ret = EINVAL ;
771
779
}
0 commit comments