Skip to content

Commit 1dcd6ae

Browse files
committed
Change declaration of function map
Newer compilers complain if funciton is declared w/o arguments, so we redeclare the xdrptoc_t as xdrfn and give it proper arguments Signed-off-by: Simo Sorce <[email protected]>
1 parent 27bdf92 commit 1dcd6ae

File tree

1 file changed

+44
-36
lines changed

1 file changed

+44
-36
lines changed

src/client/gpm_common.c

+44-36
Original file line numberDiff line numberDiff line change
@@ -600,73 +600,77 @@ OM_uint32 gpm_release_buffer(OM_uint32 *minor_status,
600600
return GSS_S_COMPLETE;
601601
}
602602

603+
/* Equivalent to xdrptoc_t but with proper arguments so that modern
604+
* compilers do not complain */
605+
typedef int xdrfn(XDR *, void *);
606+
603607
struct gpm_rpc_fn_set {
604-
xdrproc_t arg_fn;
605-
xdrproc_t res_fn;
608+
xdrfn *arg_fn;
609+
xdrfn *res_fn;
606610
} gpm_xdr_set[] = {
607611
{ /* NULLPROC */
608-
(xdrproc_t)xdr_void,
609-
(xdrproc_t)xdr_void,
612+
(xdrfn *)xdr_void,
613+
(xdrfn *)xdr_void,
610614
},
611615
{ /* 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,
614618
},
615619
{ /* 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,
618622
},
619623
{ /* 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,
622626
},
623627
{ /* 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,
626630
},
627631
{ /* 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,
630634
},
631635
{ /* 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,
634638
},
635639
{ /* 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,
638642
},
639643
{ /* 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,
642646
},
643647
{ /* 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,
646650
},
647651
{ /* 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,
650654
},
651655
{ /* 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,
654658
},
655659
{ /* 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,
658662
},
659663
{ /* 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,
662666
},
663667
{ /* 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,
666670
},
667671
{ /* 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,
670674
}
671675
};
672676

@@ -676,6 +680,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union gp_rpc_res *res)
676680
gp_rpc_msg msg;
677681
XDR xdr_call_ctx = {0};
678682
XDR xdr_reply_ctx = {0};
683+
xdrfn *arg_fn;
684+
xdrfn *res_fn;
679685
char *send_buffer = NULL;
680686
char *recv_buffer = NULL;
681687
uint32_t send_length;
@@ -726,7 +732,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union gp_rpc_res *res)
726732
}
727733

728734
/* 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);
730737
if (!xdrok) {
731738
ret = EINVAL;
732739
goto done;
@@ -765,7 +772,8 @@ int gpm_make_call(int proc, union gp_rpc_arg *arg, union gp_rpc_res *res)
765772
}
766773

767774
/* 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);
769777
if (!xdrok) {
770778
ret = EINVAL;
771779
}

0 commit comments

Comments
 (0)