mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 21:05:22 +08:00
Split out the routine rtems_assoc_name_bad().
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
@@ -135,20 +134,11 @@ rtems_assoc_local_by_name(
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
const char *rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
);
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
/* body in separate file to reduce dependency on printf */
|
||||
|
||||
|
||||
const char *
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
|
||||
|
||||
/*
|
||||
* what to return if a value is not found
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
|
||||
|
||||
+3
-13
@@ -8,7 +8,6 @@
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
@@ -135,20 +134,11 @@ rtems_assoc_local_by_name(
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
const char *rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
);
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
/* body in separate file to reduce dependency on printf */
|
||||
|
||||
|
||||
const char *
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
|
||||
|
||||
/*
|
||||
* what to return if a value is not found
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ VPATH = @srcdir@
|
||||
LIB=${ARCH}/libassoc-tmp.a
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=assoc
|
||||
C_PIECES=assoc assocnamebad
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
@@ -135,20 +134,11 @@ rtems_assoc_local_by_name(
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
const char *rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
);
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
/* body in separate file to reduce dependency on printf */
|
||||
|
||||
|
||||
const char *
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
|
||||
|
||||
/*
|
||||
* what to return if a value is not found
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ VPATH = @srcdir@
|
||||
LIB=${ARCH}/libassoc-tmp.a
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=assoc
|
||||
C_PIECES=assoc assocnamebad
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
@@ -135,20 +134,11 @@ rtems_assoc_local_by_name(
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
const char *rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
);
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
/* body in separate file to reduce dependency on printf */
|
||||
|
||||
|
||||
const char *
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
|
||||
|
||||
/*
|
||||
* what to return if a value is not found
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
@@ -135,20 +134,11 @@ rtems_assoc_local_by_name(
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
const char *rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
);
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
/* body in separate file to reduce dependency on printf */
|
||||
|
||||
|
||||
const char *
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "assoc.h"
|
||||
|
||||
#include <stdio.h> /* sprintf */
|
||||
#include <string.h> /* strcat, strcmp */
|
||||
|
||||
#define STREQ(a,b) (strcmp((a), (b)) == 0)
|
||||
#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
|
||||
|
||||
/*
|
||||
* what to return if a value is not found
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
const char *
|
||||
rtems_assoc_name_bad(
|
||||
unsigned32 bad_value
|
||||
)
|
||||
{
|
||||
#ifdef RTEMS_DEBUG
|
||||
static char bad_buffer[32];
|
||||
|
||||
sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
|
||||
#else
|
||||
static char bad_buffer[32] = "<assoc.c: BAD NAME>";
|
||||
#endif
|
||||
return bad_buffer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user