avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [patch #7212] Add pgm_read_ptr() macros to pgmspace.h


From: Dean Camera
Subject: [avr-libc-dev] [patch #7212] Add pgm_read_ptr() macros to pgmspace.h
Date: Tue, 01 Jun 2010 12:17:25 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.4) Gecko/20100527 Firefox/3.6.4

URL:
  <http://savannah.nongnu.org/patch/?7212>

                 Summary: Add pgm_read_ptr() macros to pgmspace.h
                 Project: AVR C Runtime Library
            Submitted by: abcminiuser
            Submitted on: Tue 01 Jun 2010 12:17:24 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Attached is a patch which adds new pgm_read_ptr[_near, _far] macros to
<avr/pgmspace.h>. These macros hide the internal compiler representation of
pointers from the programmer, who can instead use these macros for reading out
pointers stored in PROGMEM.

The internal mechanism for these macros is currently identical to
pgm_read_word() with the result cast to a void* type, however this leaves some
wiggle-room if the size of pointers change in the future, adds a little extra
type-safety to the user's application and improves the readability of existing
code.

- Dean



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 01 Jun 2010 12:17:24 PM GMT  Name: pgmspace.patch  Size: 2kB   By:
abcminiuser

<http://savannah.nongnu.org/patch/download.php?file_id=20670>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?7212>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]