bugAVR C Runtime Library - Bugs: bug #44306, Redundancy between rand_r() and...

 
 

bug #44306: Redundancy between rand_r() and do_rand()

Submitted by:  None
Submitted on:  Thu 19 Feb 2015 09:30:50 AM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: libc code
Status: NonePercent Complete: 0%
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: OpenRelease: Any
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 19 Feb 2015 09:30:50 AM UTC, original submission:

In libc/stdlib/rand.c, the functions rand_r() and do_rand() are
redundant relative to each other. I suggest the following:

- remove rand_r(),
- remove the "static" attribute from do_rand(),
- rename do_rand() -> rand_r(),
- have rand() call rand_r() instead of do_rand().

This should save 4 bytes of flash on every program using rand() or
rand_r(). It should also save 2 bytes of stack and 7 clock cycles on
calls to rand_r(), more if _AVR_3_BYTE_PC_.

Same thing for random_r() and do_random() in libc/stdlib/random.c.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1