Add more const-ness to the stream endpoint/pipe functions where possible.

pull/1469/head
Dean Camera 14 years ago
parent 272d446d32
commit 0019fbd129

@ -615,7 +615,8 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a # excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag. # subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = Documentation/ EXCLUDE = Documentation/ \
HostLoaderApp/
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded # directories that are symbolic links (a Unix filesystem feature) are excluded

File diff suppressed because one or more lines are too long

@ -107,12 +107,12 @@
*/ */
typedef struct typedef struct
{ {
uint8_t* In; /**< Current storage location in the circular buffer */ uint8_t* In; /**< Current storage location in the circular buffer. */
uint8_t* Out; /**< Current retrieval location in the circular buffer */ uint8_t* Out; /**< Current retrieval location in the circular buffer. */
uint8_t* Start; /**< Pointer to the start of the buffer's underlying storage array */ uint8_t* Start; /**< Pointer to the start of the buffer's underlying storage array. */
uint8_t* End; /**< Pointer to the end of the buffer's underlying storage array */ uint8_t* End; /**< Pointer to the end of the buffer's underlying storage array. */
uint8_t Size; /**< Size of the buffer's underlying storage array */ uint8_t Size; /**< Size of the buffer's underlying storage array. */
uint16_t Count; /**< Number of bytes currently stored in the buffer */ uint16_t Count; /**< Number of bytes currently stored in the buffer. */
} RingBuffer_t; } RingBuffer_t;
/* Inline Functions: */ /* Inline Functions: */

@ -280,7 +280,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_Stream_LE(const void* Buffer, uint8_t Endpoint_Write_Stream_LE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -298,7 +298,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_Stream_BE(const void* Buffer, uint8_t Endpoint_Write_Stream_BE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -357,7 +357,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint8_t Endpoint_Read_Stream_LE(void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -375,7 +375,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Read_Stream_BE(void* Buffer, uint8_t Endpoint_Read_Stream_BE(void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -398,7 +398,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint8_t Endpoint_Write_Control_Stream_LE(const void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in big endian, /** Writes the given number of bytes to the CONTROL type endpoint from the given buffer in big endian,
@ -420,7 +420,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_Control_Stream_BE(const void* Buffer, uint8_t Endpoint_Write_Control_Stream_BE(const void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** Reads the given number of bytes from the CONTROL endpoint from the given buffer in little endian, /** Reads the given number of bytes from the CONTROL endpoint from the given buffer in little endian,
@ -442,7 +442,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint8_t Endpoint_Read_Control_Stream_LE(void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** Reads the given number of bytes from the CONTROL endpoint from the given buffer in big endian, /** Reads the given number of bytes from the CONTROL endpoint from the given buffer in big endian,
@ -464,7 +464,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Read_Control_Stream_BE(void* Buffer, uint8_t Endpoint_Read_Control_Stream_BE(void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
//@} //@}
@ -480,7 +480,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_EStream_LE(const void* Buffer, uint8_t Endpoint_Write_EStream_LE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -493,7 +493,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_EStream_BE(const void* Buffer, uint8_t Endpoint_Write_EStream_BE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -506,7 +506,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Read_EStream_LE(void* Buffer, uint8_t Endpoint_Read_EStream_LE(void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -519,7 +519,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Read_EStream_BE(void* Buffer, uint8_t Endpoint_Read_EStream_BE(void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -539,7 +539,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_Control_EStream_LE(const void* Buffer, uint8_t Endpoint_Write_Control_EStream_LE(const void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** EEPROM buffer source version of \ref Endpoint_Write_Control_Stream_BE(). /** EEPROM buffer source version of \ref Endpoint_Write_Control_Stream_BE().
@ -558,7 +558,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_Control_EStream_BE(const void* Buffer, uint8_t Endpoint_Write_Control_EStream_BE(const void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** EEPROM buffer source version of \ref Endpoint_Read_Control_Stream_LE(). /** EEPROM buffer source version of \ref Endpoint_Read_Control_Stream_LE().
@ -577,7 +577,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Read_Control_EStream_LE(void* Buffer, uint8_t Endpoint_Read_Control_EStream_LE(void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** EEPROM buffer source version of \ref Endpoint_Read_Control_Stream_BE(). /** EEPROM buffer source version of \ref Endpoint_Read_Control_Stream_BE().
@ -596,7 +596,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Read_Control_EStream_BE(void* Buffer, uint8_t Endpoint_Read_Control_EStream_BE(void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
//@} //@}
@ -614,7 +614,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_PStream_LE(const void* Buffer, uint8_t Endpoint_Write_PStream_LE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -629,7 +629,7 @@
* *
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_PStream_BE(const void* Buffer, uint8_t Endpoint_Write_PStream_BE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -651,7 +651,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_Control_PStream_LE(const void* Buffer, uint8_t Endpoint_Write_Control_PStream_LE(const void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** FLASH buffer source version of \ref Endpoint_Write_Control_Stream_BE(). /** FLASH buffer source version of \ref Endpoint_Write_Control_Stream_BE().
@ -672,7 +672,7 @@
* *
* \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_ControlStream_RW_ErrorCodes_t enum.
*/ */
uint8_t Endpoint_Write_Control_PStream_BE(const void* Buffer, uint8_t Endpoint_Write_Control_PStream_BE(const void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
//@} //@}

@ -258,7 +258,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Write_Stream_LE(const void* Buffer, uint8_t Pipe_Write_Stream_LE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -278,7 +278,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Write_Stream_BE(const void* Buffer, uint8_t Pipe_Write_Stream_BE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -339,7 +339,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Read_Stream_LE(void* Buffer, uint8_t Pipe_Read_Stream_LE(void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -359,7 +359,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Read_Stream_BE(void* Buffer, uint8_t Pipe_Read_Stream_BE(void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
//@} //@}
@ -376,7 +376,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Write_EStream_LE(const void* Buffer, uint8_t Pipe_Write_EStream_LE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -389,7 +389,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Write_EStream_BE(const void* Buffer, uint8_t Pipe_Write_EStream_BE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -402,7 +402,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Read_EStream_LE(void* Buffer, uint8_t Pipe_Read_EStream_LE(void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -415,7 +415,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Read_EStream_BE(void* Buffer, uint8_t Pipe_Read_EStream_BE(void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
//@} //@}
@ -434,7 +434,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Write_PStream_LE(const void* Buffer, uint8_t Pipe_Write_PStream_LE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
@ -449,7 +449,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t Pipe_Write_PStream_BE(const void* Buffer, uint8_t Pipe_Write_PStream_BE(const void* const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
//@} //@}

@ -1,4 +1,4 @@
uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint8_t TEMPLATE_FUNC_NAME (void* const Buffer,
uint16_t Length) uint16_t Length)
{ {
uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));

@ -1,4 +1,4 @@
uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer,
uint16_t Length) uint16_t Length)
{ {
uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));

@ -1,4 +1,4 @@
uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer, uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) uint16_t* const BytesProcessed)
{ {

@ -1,4 +1,4 @@
uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer, uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
uint16_t Length, uint16_t Length,
uint16_t* const BytesProcessed) uint16_t* const BytesProcessed)
{ {

@ -9,7 +9,7 @@
* *
* \image html Author.jpg "Dean Camera, LUFA Developer" * \image html Author.jpg "Dean Camera, LUFA Developer"
* *
* I am a 21 year old University student studying for a double degree in Computer Science and Electronics Engineering. * I am a 22 year old University student studying for a double degree in Computer Science and Electronics Engineering.
* The development and support of this library requires much effort from myself, as I am the sole developer, maintainer * The development and support of this library requires much effort from myself, as I am the sole developer, maintainer
* and supporter. Please consider donating a small amount to support this and my future Open Source projects - All * and supporter. Please consider donating a small amount to support this and my future Open Source projects - All
* donations are <i>greatly</i> appreciated. * donations are <i>greatly</i> appreciated.

@ -615,7 +615,10 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a # excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag. # subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = Documentation/ CPUUsageApp/ HotmailNotifierApp/ LEDMixerApp/ EXCLUDE = Documentation/ \
CPUUsageApp/ \
HotmailNotifierApp/ \
LEDMixerApp/
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded # directories that are symbolic links (a Unix filesystem feature) are excluded

@ -615,7 +615,8 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a # excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag. # subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = Documentation/ TempLogHostApp/ EXCLUDE = Documentation/ \
TempLogHostApp/
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded # directories that are symbolic links (a Unix filesystem feature) are excluded

@ -14,7 +14,6 @@
# "make clean_doxygen" to remove generated Doxygen documentation from everything. # "make clean_doxygen" to remove generated Doxygen documentation from everything.
all: all:
%: %:
@echo Executing \"make $@\" on all LUFA library elements. @echo Executing \"make $@\" on all LUFA library elements.
@echo @echo

Loading…
Cancel
Save