string literals are now const so declare args as such to suppress compiler warnings
r3634 | dcl | 2012-07-11 11:59:16 +1000 (Wed, 11 Jul 2012) | 1 line
This commit is contained in:
@@ -368,7 +368,7 @@ int device_command(void* counter, const char* command)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void device_event(DEVICE *device, char* event)
|
static void device_event(DEVICE *device, const char* event)
|
||||||
{
|
{
|
||||||
BUFFER buffer;
|
BUFFER buffer;
|
||||||
sprintf(buffer.body, "EVENT %s %s\r\n",
|
sprintf(buffer.body, "EVENT %s %s\r\n",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
* The browser will return name=value for the selection, using the name from
|
* The browser will return name=value for the selection, using the name from
|
||||||
* the selection box and the value from the option selected.
|
* the selection box and the value from the option selected.
|
||||||
*/
|
*/
|
||||||
static void add_select_begin(BUFFER* buffer, char* title, char* name)
|
static void add_select_begin(BUFFER* buffer, const char* title, const char* name)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
||||||
@@ -41,7 +41,7 @@ static void add_select_begin(BUFFER* buffer, char* title, char* name)
|
|||||||
* The browser will return name=value for the selection, using the name from
|
* The browser will return name=value for the selection, using the name from
|
||||||
* the selection box and the value from the option selected.
|
* the selection box and the value from the option selected.
|
||||||
*/
|
*/
|
||||||
static void add_option(BUFFER* buffer, char* name, char* value, bool selected)
|
static void add_option(BUFFER* buffer, const char* name, const char* value, bool selected)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
||||||
@@ -69,7 +69,7 @@ static void add_select_end(BUFFER* buffer)
|
|||||||
*
|
*
|
||||||
* \param buffer where the text is appended
|
* \param buffer where the text is appended
|
||||||
*/
|
*/
|
||||||
static void add_text(BUFFER* buffer, char* text)
|
static void add_text(BUFFER* buffer, const char* text)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length, "%s", text);
|
snprintf(bp, sizeof(buffer->body) - buffer->length, "%s", text);
|
||||||
@@ -87,7 +87,7 @@ static void add_text(BUFFER* buffer, char* text)
|
|||||||
* The title is displayed in column one and the integer in column two. The
|
* The title is displayed in column one and the integer in column two. The
|
||||||
* name=value is returned by the browser.
|
* name=value is returned by the browser.
|
||||||
*/
|
*/
|
||||||
static void add_int(BUFFER* buffer, char* title, char* name, int value)
|
static void add_int(BUFFER* buffer, const char* title, const char* name, int value)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
||||||
@@ -111,7 +111,7 @@ static void add_int(BUFFER* buffer, char* title, char* name, int value)
|
|||||||
* The title is displayed in column one and the double in column two. The
|
* The title is displayed in column one and the double in column two. The
|
||||||
* name=value is returned by the browser.
|
* name=value is returned by the browser.
|
||||||
*/
|
*/
|
||||||
static void add_double(BUFFER* buffer, char* title, char* name, double value)
|
static void add_double(BUFFER* buffer, const char* title, const char* name, double value)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
||||||
@@ -135,7 +135,7 @@ static void add_double(BUFFER* buffer, char* title, char* name, double value)
|
|||||||
* The title is displayed in column one and the counter value in column two.
|
* The title is displayed in column one and the counter value in column two.
|
||||||
* The name=value is returned by the browser.
|
* The name=value is returned by the browser.
|
||||||
*/
|
*/
|
||||||
static void add_counter(BUFFER* buffer, char* title, char* name, uint64 value)
|
static void add_counter(BUFFER* buffer, const char* title, const char* name, uint64 value)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
||||||
@@ -266,7 +266,7 @@ static void show_text(BUFFER* buffer, const char* title, const char* value)
|
|||||||
buffer->length += strlen(bp);
|
buffer->length += strlen(bp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_int(BUFFER* buffer, char* title, int value)
|
static void show_int(BUFFER* buffer, const char* title, int value)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
||||||
@@ -278,7 +278,7 @@ static void show_int(BUFFER* buffer, char* title, int value)
|
|||||||
buffer->length += strlen(bp);
|
buffer->length += strlen(bp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_real(BUFFER* buffer, char* title, double value)
|
static void show_real(BUFFER* buffer, const char* title, double value)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
||||||
@@ -290,7 +290,7 @@ static void show_real(BUFFER* buffer, char* title, double value)
|
|||||||
buffer->length += strlen(bp);
|
buffer->length += strlen(bp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_counter(BUFFER* buffer, char* title, unsigned long long value)
|
static void show_counter(BUFFER* buffer, const char* title, unsigned long long value)
|
||||||
{
|
{
|
||||||
char* bp = &buffer->body[buffer->length];
|
char* bp = &buffer->body[buffer->length];
|
||||||
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
snprintf(bp, sizeof(buffer->body) - buffer->length,
|
||||||
@@ -303,7 +303,7 @@ static void show_counter(BUFFER* buffer, char* title, unsigned long long value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void show_time(BUFFER* buffer,
|
static void show_time(BUFFER* buffer,
|
||||||
char* title,
|
const char* title,
|
||||||
struct timeval* value,
|
struct timeval* value,
|
||||||
bool days_flag)
|
bool days_flag)
|
||||||
{
|
{
|
||||||
@@ -391,7 +391,7 @@ void put_page(int n)
|
|||||||
show_real(&buffer, "Max", sp->maximum_rate);
|
show_real(&buffer, "Max", sp->maximum_rate);
|
||||||
if (pp->range_check_enable)
|
if (pp->range_check_enable)
|
||||||
{
|
{
|
||||||
char* result;
|
const char* result;
|
||||||
if (device->range_error == 1)
|
if (device->range_error == 1)
|
||||||
result = "<font color=\"BLUE\">LOW</font>";
|
result = "<font color=\"BLUE\">LOW</font>";
|
||||||
else if (device->range_error == 2)
|
else if (device->range_error == 2)
|
||||||
|
|||||||
@@ -38,8 +38,8 @@
|
|||||||
#define TXT_FILTER "FILTER"
|
#define TXT_FILTER "FILTER"
|
||||||
|
|
||||||
static struct param_command_t {
|
static struct param_command_t {
|
||||||
int cmd;
|
const int cmd;
|
||||||
char* txt;
|
const char* txt;
|
||||||
} param_command[] = {
|
} param_command[] = {
|
||||||
{CMD_DIRECTION, TXT_DIRECTION},
|
{CMD_DIRECTION, TXT_DIRECTION},
|
||||||
{CMD_SCAN, TXT_SCAN},
|
{CMD_SCAN, TXT_SCAN},
|
||||||
@@ -278,7 +278,7 @@ bool param_set_cmd(pPARAMETERS pp, char* cmd)
|
|||||||
return param_set(pp, name, value);
|
return param_set(pp, name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool param_get_cmd(pPARAMETERS pp, char* cmd, int n)
|
bool param_get_cmd(pPARAMETERS pp, const char* cmd, int n)
|
||||||
{
|
{
|
||||||
char name[100];
|
char name[100];
|
||||||
int len;
|
int len;
|
||||||
|
|||||||
Reference in New Issue
Block a user