public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sid/sim: constify sim_machs storage
@ 2021-06-28 15:34 Mike Frysinger
  2021-09-10 21:59 ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2021-06-28 15:34 UTC (permalink / raw)
  To: cgen

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sid/sim: constify sim_machs storage
  2021-06-28 15:34 [PATCH] sid/sim: constify sim_machs storage Mike Frysinger
@ 2021-09-10 21:59 ` Mike Frysinger
  2021-09-14 19:02   ` Jose E. Marchesi
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2021-09-10 21:59 UTC (permalink / raw)
  To: cgen

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sid/sim: constify sim_machs storage
  2021-09-10 21:59 ` Mike Frysinger
@ 2021-09-14 19:02   ` Jose E. Marchesi
  0 siblings, 0 replies; 3+ messages in thread
From: Jose E. Marchesi @ 2021-09-14 19:02 UTC (permalink / raw)
  To: cgen


> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-14 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 15:34 [PATCH] sid/sim: constify sim_machs storage Mike Frysinger
2021-09-10 21:59 ` Mike Frysinger
2021-09-14 19:02   ` Jose E. Marchesi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).