Probably does not matter much..
# DEBUG_CPPFLAGS += -Wextra
# DEBUG_CPPFLAGS += -Wold-style-definition
# DEBUG_CPPFLAGS += -Wdeclaration-after-statement
+# DEBUG_CPPFLAGS += -Wsuggest-attribute=const
# many warnings about trivial stuff
# CPPFLAGS += -Wconversion
*
* This table does not honor events.
*/
-int images_event_handler(__a_unused enum afs_events event,
+__a_const int images_event_handler(__a_unused enum afs_events event,
__a_unused struct para_buffer *pb, __a_unused void *data)
{
return 1;
*
* This table does not honor events.
*/
-int lyrics_event_handler(__a_unused enum afs_events event,
+__a_const int lyrics_event_handler(__a_unused enum afs_events event,
__a_unused struct para_buffer *pb, __a_unused void *data)
{
return 1;
} \
}
-static short unsigned get_duration_width(int seconds)
+__a_const static short unsigned get_duration_width(int seconds)
{
short unsigned width;
unsigned hours = seconds / 3600, mins = (seconds % 3600) / 60;
#define gf_mul(x,y) gf_mul_table[x][y]
/* Compute x % GF_SIZE without a slow divide. */
-static inline unsigned char modnn(int x)
+__a_const static inline unsigned char modnn(int x)
{
while (x >= GF_SIZE) {
x -= GF_SIZE;
* the number of the first variadic parameter.
*/
# define __printf(p,q) __attribute__ ((format (printf, p, q)))
+# define __a_const __attribute__ ((const))
/*
* as direct use of __printf(p,q) confuses doxygen, here are two extra macros
* for those values p,q that are actually used by paraslash.
cos_4096, cos_8192, cos_16384, cos_32768, cos_65536,
};
-static int split_radix_permutation(int i, int n)
+__a_const static int split_radix_permutation(int i, int n)
{
int m;
if (n <= 2)
static struct mood *current_mood;
/**
- * Rough approximation to sqrt.
+ * Rough approximation to sqrt.
*
- * \param x Integer of which to calculate the sqrt.
+ * \param x Integer of which to calculate the sqrt.
*
- * \return An integer res with res * res <= x.
+ * \return An integer res with res * res <= x.
*/
-static uint64_t int_sqrt(uint64_t x)
+__a_const static uint64_t int_sqrt(uint64_t x)
{
uint64_t op, res, one = 1;
op = x;
*
* \return An integer approximation of log2(v).
*/
-int wma_log2(unsigned int v)
+__a_const int wma_log2(unsigned int v)
{
int n = 0;
if (v & 0xffff0000) {