[Top][All Lists]

[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: Gecko/20100527 Firefox/3.6.4


                 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



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

- Dean


File Attachments:

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



Reply to this item at:


  Message sent via/by Savannah

reply via email to

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