
# HG changeset patch # User Zhengang Li <lizg@cn.ibm.com> # Date 1204076903 -28800 # Node ID 8ef92e008bcbcf2336cbccfa083c2d22f690ca1d # Parent b2606bc023a8a26ecd25464e976fb16606ed3a47 [CU] Fix const pointer warning Signed-off-by: Zhengang Li <lizg@cn.ibm.com> diff -r b2606bc023a8 -r 8ef92e008bcb instance_util.c --- a/instance_util.c Tue Feb 26 15:16:00 2008 -0500 +++ b/instance_util.c Wed Feb 27 09:48:23 2008 +0800 @@ -255,7 +255,7 @@ CMPIInstance *cu_dup_instance(const CMPI const char *cu_classname_from_inst(CMPIInstance *inst) { - char *ret = NULL; + const char *ret = NULL; CMPIObjectPath *ref; ref = CMGetObjectPath(inst, NULL); diff -r b2606bc023a8 -r 8ef92e008bcb std_indication.c --- a/std_indication.c Tue Feb 26 15:16:00 2008 -0500 +++ b/std_indication.c Wed Feb 27 09:48:23 2008 +0800 @@ -214,7 +214,7 @@ CMPIStatus stdi_activate_filter(CMPIIndi char *cn = NULL; _ctx = (struct std_indication_ctx *)mi->hdl; - cn = CLASSNAME(op); + cn = (char *)CLASSNAME(op); s = stdi_set_ind_filter_state(_ctx, cn, true); if (_ctx->handler != NULL && _ctx->handler->activate_fn != NULL) { @@ -239,7 +239,7 @@ CMPIStatus stdi_deactivate_filter(CMPIIn char *cn = NULL; _ctx = (struct std_indication_ctx *)mi->hdl; - cn = CLASSNAME(op); + cn = (char *)CLASSNAME(op); s = stdi_set_ind_filter_state(_ctx, cn, false); if (_ctx->handler != NULL && _ctx->handler->deactivate_fn != NULL) {

lizg@cn.ibm.com wrote:
# HG changeset patch # User Zhengang Li <lizg@cn.ibm.com> # Date 1204076903 -28800 # Node ID 8ef92e008bcbcf2336cbccfa083c2d22f690ca1d # Parent b2606bc023a8a26ecd25464e976fb16606ed3a47 [CU] Fix const pointer warning
Signed-off-by: Zhengang Li <lizg@cn.ibm.com>
Some day, the const keyword and I are gonna sit down and have a long talk. Thanks for catching this. +1 -- -Jay

ZL> diff -r b2606bc023a8 -r 8ef92e008bcb std_indication.c ZL> --- a/std_indication.c Tue Feb 26 15:16:00 2008 -0500 ZL> +++ b/std_indication.c Wed Feb 27 09:48:23 2008 +0800 ZL> @@ -214,7 +214,7 @@ CMPIStatus stdi_activate_filter(CMPIIndi ZL> char *cn = NULL; ZL> _ctx = (struct std_indication_ctx *)mi->hdl; ZL> - cn = CLASSNAME(op); ZL> + cn = (char *)CLASSNAME(op); ZL> s = stdi_set_ind_filter_state(_ctx, cn, true); Shouldn't we change cn to be a const char *, instead of casting it to char *? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
ZL> diff -r b2606bc023a8 -r 8ef92e008bcb std_indication.c ZL> --- a/std_indication.c Tue Feb 26 15:16:00 2008 -0500 ZL> +++ b/std_indication.c Wed Feb 27 09:48:23 2008 +0800 ZL> @@ -214,7 +214,7 @@ CMPIStatus stdi_activate_filter(CMPIIndi ZL> char *cn = NULL;
ZL> _ctx = (struct std_indication_ctx *)mi->hdl; ZL> - cn = CLASSNAME(op); ZL> + cn = (char *)CLASSNAME(op); ZL> s = stdi_set_ind_filter_state(_ctx, cn, true);
Shouldn't we change cn to be a const char *, instead of casting it to char *? It was my 1st idea. And then it turns out the 2nd param to stdi_set_ind_filter_state() is a 'char *'. Change that, too?
------------------------------------------------------------------------
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- - Zhengang

ZL> It was my 1st idea. And then it turns out the 2nd param to ZL> stdi_set_ind_filter_state() is a 'char *'. Change that, too? Please do :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (4)
-
Dan Smith
-
Jay Gagnon
-
lizg@cn.ibm.com
-
Zhengang Li