[PATCH] sid/sim: constify sim_machs storage

Jose E. Marchesi jemarch@gnu.org
Tue Sep 14 19:02:25 GMT 2021


> ping ...
>
> On 28 Jun 2021 11:34, Mike Frysinger via Cgen wrote:
>> The array itself is read-only, so mark it const.
>> ---
>>  sid.scm | 2 +-
>>  sim.scm | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/sid.scm b/sid.scm
>> index d6d6ed30a890..c34338371d82 100644
>> --- a/sid.scm
>> +++ b/sid.scm
>> @@ -1361,7 +1361,7 @@
>>  
>>  (define (/gen-mach-data)
>>    (string-append
>> -   "const MACH *sim_machs[] =\n{\n"
>> +   "const MACH * const sim_machs[] =\n{\n"
>>     (string-map (lambda (mach)
>>  		 (gen-obj-sanitize
>>  		  mach
>> diff --git a/sim.scm b/sim.scm
>> index f965ef1fcb17..a153f8cee720 100644
>> --- a/sim.scm
>> +++ b/sim.scm
>> @@ -1475,7 +1475,7 @@
>>  
>>  (define (/gen-mach-data)
>>    (string-append
>> -   "const SIM_MACH *sim_machs[] =\n{\n"
>> +   "const SIM_MACH * const sim_machs[] =\n{\n"
>>     (string-map (lambda (mach)
>>  		 (gen-obj-sanitize
>>  		  mach
>> -- 
>> 2.31.1
>> 

This LGTM.


More information about the Cgen mailing list