replace 'unsigned const char' with 'const unsigned char'
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Mon, 21 Dec 2020 14:17:24 +0000 (15:17 +0100)
committerNicola Tuveri <nic.tuv@gmail.com>
Fri, 8 Jan 2021 22:20:16 +0000 (00:20 +0200)
commit6d4313f03eddd39ca8d06a5e1d20fc1adcb207c5
treedd124327109474b4317d2bb9a16d6092b3626acb
parent1330093b9c7e0325ca76589fb9ace5b664830c6d
replace 'unsigned const char' with 'const unsigned char'

The openssl code base has only a few occurrences of 'unsigned const char'
(15 occurrences), compared to the more common 'const unsigned char' (4420
occurrences).

While the former is not illegal C, mixing the 'const' keyword (a 'type
qualifier') in between 'unsigned' and 'char' (both 'type specifiers') is a
bit odd.

The background for writing this patch is not to be pedantic, but because
the 'opmock' program (used to mock headers for unit tests) does not accept
the 'unsigned const char' construct. While this definitely is a bug in
opmock or one of its dependencies, openssl is the only piece of software we
are using in combination with opmock that has this construct.

CLA: trivial

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/13722)
apps/passwd.c
crypto/des/fcrypt.c
doc/man3/SSL_CTX_dane_enable.pod
include/openssl/ssl.h.in
ssl/ssl_lib.c