]> git.ipfire.org Git - thirdparty/libvirt.git/commit
maint: avoid 'const fooPtr' in cpu files
authorEric Blake <eblake@redhat.com>
Sat, 5 Oct 2013 20:01:02 +0000 (14:01 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 14 Oct 2013 19:11:20 +0000 (13:11 -0600)
commitd694ae0c55b4cd1349f6ef63429fbe7cd7c560b6
tree73f04fe3d3d0b20438232ed356191f822dd972d0
parent955af4d4c17f1000687b70d7b1dddc79b982b865
maint: avoid 'const fooPtr' in cpu files

'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can).  But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).

Fix up offenders in src/cpu.

* src/cpu/cpu.h (cpuArchDecode, cpuArchEncode, cpuArchUpdate)
(cpuArchHasFeature, cpuDecode, cpuEncode, cpuUpdate)
(cpuHasFeature): Use intended type.
* src/conf/cpu_conf.h (virCPUDefCopyModel, virCPUDefCopy):
Likewise.
(virCPUDefParseXML): Drop const.
* src/cpu/cpu.c (cpuDecode, cpuEncode, cpuUpdate, cpuHasFeature):
Fix fallout.
* src/cpu/cpu_x86.c (x86ModelFromCPU, x86ModelSubtractCPU)
(x86DecodeCPUData, x86EncodePolicy, x86Encode, x86UpdateCustom)
(x86UpdateHostModel, x86Update, x86HasFeature): Likewise.
* src/cpu/cpu_s390.c (s390Decode): Likewise.
* src/cpu/cpu_arm.c (ArmDecode): Likewise.
* src/cpu/cpu_powerpc.c (ppcModelFromCPU, ppcCompute, ppcDecode)
(ppcUpdate): Likewise.
* src/conf/cpu_conf.c (virCPUDefCopyModel, virCPUDefCopy)
(virCPUDefParseXML): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/conf/cpu_conf.c
src/conf/cpu_conf.h
src/cpu/cpu.c
src/cpu/cpu.h
src/cpu/cpu_arm.c
src/cpu/cpu_powerpc.c
src/cpu/cpu_s390.c
src/cpu/cpu_x86.c