change log for rtems (2011-12-13)

rtems-vc at rtems.org rtems-vc at rtems.org
Tue Dec 13 10:10:39 UTC 2011


 *sh*:
2011-12-13	Sebastian Huber <sebastian.huber at embedded-brains.de>

	* psxconfig01/init.c: Create more objects.

M  1.381  testsuites/psxtests/ChangeLog
M    1.3  testsuites/psxtests/psxconfig01/init.c

diff -u rtems/testsuites/psxtests/ChangeLog:1.380 rtems/testsuites/psxtests/ChangeLog:1.381
--- rtems/testsuites/psxtests/ChangeLog:1.380	Tue Dec 13 03:40:07 2011
+++ rtems/testsuites/psxtests/ChangeLog	Tue Dec 13 04:02:35 2011
@@ -1,3 +1,7 @@
+2011-12-13	Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+	* psxconfig01/init.c: Create more objects.
+
 2011-12-13	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	* psx07/init.c: Remove unused var "clock_allowed".

diff -u rtems/testsuites/psxtests/psxconfig01/init.c:1.2 rtems/testsuites/psxtests/psxconfig01/init.c:1.3
--- rtems/testsuites/psxtests/psxconfig01/init.c:1.2	Fri Dec  9 10:44:15 2011
+++ rtems/testsuites/psxtests/psxconfig01/init.c	Tue Dec 13 04:02:36 2011
@@ -30,39 +30,16 @@
 
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <inttypes.h>
+#include <mqueue.h>
 #include <pthread.h>
+#include <semaphore.h>
+#include <signal.h>
 #include <stdio.h>
-#include <inttypes.h>
-
-#define MQ_0_COUNT 2
-#define MQ_1_COUNT 3
-#define MQ_2_COUNT 5
-#define MQ_3_COUNT 7
-#define MQ_4_COUNT 11
-#define MQ_5_COUNT 13
-#define MQ_6_COUNT 17
-
-#define MQ_0_SIZE 101
-#define MQ_1_SIZE 103
-#define MQ_2_SIZE 107
-#define MQ_3_SIZE 109
-#define MQ_4_SIZE 113
-#define MQ_5_SIZE 127
-#define MQ_6_SIZE 131
-
-#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
-  CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_0_COUNT, MQ_0_SIZE) \
-    + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_1_COUNT, MQ_1_SIZE) \
-    + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_2_COUNT, MQ_2_SIZE) \
-    + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_3_COUNT, MQ_3_SIZE) \
-    + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_4_COUNT, MQ_4_SIZE) \
-    + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_5_COUNT, MQ_5_SIZE) \
-    + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_6_COUNT, MQ_6_SIZE)
+#include <time.h>
 
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 17
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
 
-#define CONFIGURE_MAXIMUM_BARRIERS 31
-#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 7
 #define CONFIGURE_MAXIMUM_PARTITIONS 37
 #define CONFIGURE_MAXIMUM_PERIODS 41
 #define CONFIGURE_MAXIMUM_REGIONS 43
@@ -70,42 +47,144 @@
 #define CONFIGURE_MAXIMUM_TASKS 11
 #define CONFIGURE_MAXIMUM_TASK_VARIABLES 13
 #define CONFIGURE_MAXIMUM_TIMERS 59
+#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 17
 
+#define CONFIGURE_MAXIMUM_POSIX_BARRIERS 31
 #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 29
 #define CONFIGURE_MAXIMUM_POSIX_KEYS 23
+#define POSIX_MQ_COUNT 5
 #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 19
+#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 7
+#define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 31
+#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 41
+#define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 17
 #define CONFIGURE_MAXIMUM_POSIX_THREADS 3
+#define CONFIGURE_MAXIMUM_POSIX_TIMERS 47
 
-static const uint8_t mq_counts [CONFIGURE_MAXIMUM_MESSAGE_QUEUES] = {
-  MQ_0_COUNT,
-  MQ_1_COUNT,
-  MQ_2_COUNT,
-  MQ_3_COUNT,
-  MQ_4_COUNT,
-  MQ_5_COUNT,
-  MQ_6_COUNT
-};
-
-static const uint8_t mq_sizes [CONFIGURE_MAXIMUM_MESSAGE_QUEUES] = {
-  MQ_0_SIZE,
-  MQ_1_SIZE,
-  MQ_2_SIZE,
-  MQ_3_SIZE,
-  MQ_4_SIZE,
-  MQ_5_SIZE,
-  MQ_6_SIZE
-};
+#ifndef CONFIGURE_MAXIMUM_TASKS
+  #define CONFIGURE_MAXIMUM_TASKS 1
+#endif
+
+#ifdef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
+  #define MQ_0_COUNT 2
+  #define MQ_1_COUNT 3
+  #define MQ_2_COUNT 5
+  #define MQ_3_COUNT 7
+  #define MQ_4_COUNT 11
+  #define MQ_5_COUNT 13
+  #define MQ_6_COUNT 17
+
+  #define MQ_0_SIZE 101
+  #define MQ_1_SIZE 103
+  #define MQ_2_SIZE 107
+  #define MQ_3_SIZE 109
+  #define MQ_4_SIZE 113
+  #define MQ_5_SIZE 127
+  #define MQ_6_SIZE 131
+
+  #define MQ_BUFFER_MEMORY \
+    (CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_0_COUNT, MQ_0_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_1_COUNT, MQ_1_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_2_COUNT, MQ_2_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_3_COUNT, MQ_3_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_4_COUNT, MQ_4_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_5_COUNT, MQ_5_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_6_COUNT, MQ_6_SIZE))
+
+  static const uint8_t mq_counts [CONFIGURE_MAXIMUM_MESSAGE_QUEUES] = {
+    MQ_0_COUNT,
+    MQ_1_COUNT,
+    MQ_2_COUNT,
+    MQ_3_COUNT,
+    MQ_4_COUNT,
+    MQ_5_COUNT,
+    MQ_6_COUNT
+  };
+
+  static const uint8_t mq_sizes [CONFIGURE_MAXIMUM_MESSAGE_QUEUES] = {
+    MQ_0_SIZE,
+    MQ_1_SIZE,
+    MQ_2_SIZE,
+    MQ_3_SIZE,
+    MQ_4_SIZE,
+    MQ_5_SIZE,
+    MQ_6_SIZE
+  };
+#else
+  #define MQ_BUFFER_MEMORY 0
+#endif
+
+#ifdef POSIX_MQ_COUNT
+  #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS POSIX_MQ_COUNT
+  #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES POSIX_MQ_COUNT
+
+  #define POSIX_MQ_0_COUNT 2
+  #define POSIX_MQ_1_COUNT 3
+  #define POSIX_MQ_2_COUNT 5
+  #define POSIX_MQ_3_COUNT 7
+  #define POSIX_MQ_4_COUNT 11
+
+  #define POSIX_MQ_0_SIZE 137
+  #define POSIX_MQ_1_SIZE 139
+  #define POSIX_MQ_2_SIZE 149
+  #define POSIX_MQ_3_SIZE 151
+  #define POSIX_MQ_4_SIZE 157
+
+  #define POSIX_MQ_BUFFER_MEMORY \
+    (CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_0_COUNT, POSIX_MQ_0_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_1_COUNT, POSIX_MQ_1_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_2_COUNT, POSIX_MQ_2_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_3_COUNT, POSIX_MQ_3_SIZE) \
+      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_4_COUNT, POSIX_MQ_4_SIZE))
+
+  static const uint8_t posix_mq_counts [POSIX_MQ_COUNT] = {
+    POSIX_MQ_0_COUNT,
+    POSIX_MQ_1_COUNT,
+    POSIX_MQ_2_COUNT,
+    POSIX_MQ_3_COUNT,
+    POSIX_MQ_4_COUNT
+  };
+
+  static const uint8_t posix_mq_sizes [POSIX_MQ_COUNT] = {
+    POSIX_MQ_0_SIZE,
+    POSIX_MQ_1_SIZE,
+    POSIX_MQ_2_SIZE,
+    POSIX_MQ_3_SIZE,
+    POSIX_MQ_4_SIZE
+  };
+#else
+  #define POSIX_MQ_BUFFER_MEMORY 0
+#endif
+
+#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
+  (MQ_BUFFER_MEMORY + POSIX_MQ_BUFFER_MEMORY)
 
 typedef struct {
   uint64_t data [16];
 } area;
 
-static area partition_areas [CONFIGURE_MAXIMUM_PARTITIONS];
+#ifdef CONFIGURE_MAXIMUM_PARTITIONS
+  static area partition_areas [CONFIGURE_MAXIMUM_PARTITIONS];
+#endif
+
+#ifdef CONFIGURE_MAXIMUM_REGIONS
+  static area region_areas [CONFIGURE_MAXIMUM_REGIONS];
+#endif
 
-static area region_areas [CONFIGURE_MAXIMUM_REGIONS];
+static char posix_name [NAME_MAX];
 
 static void *task_var;
 
+static char *get_posix_name(char a, char b, char c, int i)
+{
+  posix_name [NAME_MAX - 5] = a;
+  posix_name [NAME_MAX - 4] = b;
+  posix_name [NAME_MAX - 3] = c;
+  posix_name [NAME_MAX - 2] = 'A' + i;
+
+  return posix_name;
+}
+
 static void task_var_dtor(void *var __attribute__((unused)))
 {
   /* Do nothing */
@@ -143,37 +222,48 @@
   );
 }
 
-rtems_task Init(rtems_task_argument argument)
+static rtems_task Init(rtems_task_argument argument)
 {
   rtems_status_code sc = RTEMS_SUCCESSFUL;
+  int eno = 0;
+  int rv = 0;
   rtems_id id = RTEMS_ID_NONE;
   rtems_name name = rtems_build_name('C', 'O', 'N', 'F');
   rtems_extensions_table table;
-  int oflag = O_WRONLY | O_CREAT | O_TRUNC;
-  mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
-  int fd_a = open("/a", oflag, mode);
-  int fd_b = open("/b", oflag, mode);
   int i = 0;
-  int eno = 0;
 
   puts("\n\n*** POSIX TEST CONFIG 01 ***");
 
+  memset(posix_name, 'P', sizeof(posix_name) - 1);
+
   print_info();
 
-  rtems_test_assert(fd_a == 3);
-  rtems_test_assert(fd_b == 4);
+#ifdef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
+  for (i = 3; i < CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; ++i) {
+    int oflag = O_WRONLY | O_CREAT | O_TRUNC;
+    mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+    char path [] = { 'F', 'I', 'L', 'E', 'A' + i, '\0' };
+    int fd = open(path, oflag, mode);
+    rtems_test_assert(fd == i);
+  }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_USER_EXTENSIONS
   memset(&table, 0, sizeof(table));
   for (i = 0; i < CONFIGURE_MAXIMUM_USER_EXTENSIONS; ++i) {
     sc = rtems_extension_create(name, &table, &id);
     directive_failed(sc, "rtems_extension_create");
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_BARRIERS
   for (i = 0; i < CONFIGURE_MAXIMUM_BARRIERS; ++i) {
     sc = rtems_barrier_create(name, RTEMS_DEFAULT_ATTRIBUTES, 1, &id);
     directive_failed(sc, "rtems_barrier_create");
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
   for (i = 0; i < CONFIGURE_MAXIMUM_MESSAGE_QUEUES; ++i) {
     sc = rtems_message_queue_create(
       name,
@@ -184,7 +274,9 @@
     );
     directive_failed(sc, "rtems_message_queue_create");
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_PARTITIONS
   for (i = 0; i < CONFIGURE_MAXIMUM_PARTITIONS; ++i) {
     sc = rtems_partition_create(
       name,
@@ -196,12 +288,16 @@
     );
     directive_failed(sc, "rtems_partition_create");
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_PERIODS
   for (i = 0; i < CONFIGURE_MAXIMUM_PERIODS; ++i) {
     sc = rtems_rate_monotonic_create(name, &id);
     directive_failed(sc, "rtems_rate_monotonic_create");
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_REGIONS
   for (i = 0; i < CONFIGURE_MAXIMUM_REGIONS; ++i) {
     sc = rtems_region_create(
       name,
@@ -213,7 +309,9 @@
     );
     directive_failed(sc, "rtems_region_create");
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_SEMAPHORES
   for (i = 0; i < CONFIGURE_MAXIMUM_SEMAPHORES; ++i) {
     sc = rtems_semaphore_create(
       name,
@@ -224,8 +322,10 @@
     );
     directive_failed(sc, "rtems_semaphore_create");
   }
+#endif
 
-  for (i = 0; i < CONFIGURE_MAXIMUM_TASKS - 1; ++i) {
+#ifdef CONFIGURE_MAXIMUM_TASKS
+  for (i = 1; i < CONFIGURE_MAXIMUM_TASKS; ++i) {
     sc = rtems_task_create(
       name,
       RTEMS_MINIMUM_PRIORITY,
@@ -236,40 +336,110 @@
     );
     directive_failed(sc, "rtems_task_create");
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_TASK_VARIABLES
   for (i = 0; i < CONFIGURE_MAXIMUM_TASK_VARIABLES; ++i) {
     sc = rtems_task_variable_add(RTEMS_SELF, &task_var, task_var_dtor);
     directive_failed(sc, "rtems_task_variable_add");
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_TIMERS
   for (i = 0; i < CONFIGURE_MAXIMUM_TIMERS; ++i) {
     sc = rtems_timer_create(name, &id);
     directive_failed(sc, "rtems_timer_create");
   }
+#endif
+
+#ifdef CONFIGURE_MAXIMUM_POSIX_BARRIERS
+  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_BARRIERS; ++i) {
+    pthread_barrier_t barrier;
+    eno = pthread_barrier_init(&barrier, NULL, 1);
+    rtems_test_assert(eno == 0);
+  }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
   for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES; ++i) {
     pthread_cond_t cond;
     eno = pthread_cond_init(&cond, NULL);
     rtems_test_assert(eno == 0);
   }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_POSIX_KEYS
   for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_KEYS; ++i) {
     pthread_key_t key;
     eno = pthread_key_create(&key, posix_key_dtor);
     rtems_test_assert(eno == 0);
   }
+#endif
 
+#ifdef POSIX_MQ_COUNT
+  for (i = 0; i < POSIX_MQ_COUNT; ++i) {
+    int oflag = O_RDWR | O_CREAT | O_EXCL;
+    mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+    struct mq_attr attr = {
+      .mq_maxmsg = posix_mq_counts [i],
+      .mq_msgsize = posix_mq_sizes [i]
+    };
+    char *path = get_posix_name('M', 'S', 'Q', i);
+    mqd_t mq = mq_open(path, oflag, mode, &attr);
+    rtems_test_assert(mq >= 0);
+  }
+#endif
+
+#ifdef CONFIGURE_MAXIMUM_POSIX_MUTEXES
   for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_MUTEXES; ++i) {
     pthread_mutex_t mutex;
     eno = pthread_mutex_init(&mutex, NULL);
     rtems_test_assert(eno == 0);
   }
+#endif
+
+#ifdef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
+  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_RWLOCKS; ++i) {
+    pthread_rwlock_t rwlock;
+    eno = pthread_rwlock_init(&rwlock, NULL);
+    rtems_test_assert(eno == 0);
+  }
+#endif
+
+#ifdef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
+  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; ++i) {
+    int oflag = O_RDWR | O_CREAT | O_EXCL;
+    mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+    unsigned int value = 0;
+    char *path = get_posix_name('S', 'E', 'M', i);
+    sem_t *sem = sem_open(path, oflag, mode, value);
+    rtems_test_assert(sem != SEM_FAILED);
+  }
+#endif
+
+#ifdef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
+  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SPINLOCKS; ++i) {
+    pthread_spinlock_t spinlock;
+    eno = pthread_spin_init(&spinlock, 0);
+    rtems_test_assert(eno == 0);
+  }
+#endif
 
+#ifdef CONFIGURE_MAXIMUM_POSIX_THREADS
   for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_THREADS; ++i) {
     pthread_t thread;
     eno = pthread_create(&thread, NULL, posix_thread, NULL);
     rtems_test_assert(eno == 0);
   }
+#endif
+
+#ifdef CONFIGURE_MAXIMUM_POSIX_TIMERS
+  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_TIMERS; ++i) {
+    timer_t timer_id;
+    rv = timer_create(CLOCK_REALTIME, NULL, &timer_id);
+    rtems_test_assert(rv == 0);
+  }
+#endif
 
   printf("object creation done\n");
   print_info();
@@ -282,8 +452,6 @@
 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
 
-#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
-
 #define CONFIGURE_MAXIMUM_DRIVERS 2
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE


 *sh*:
2011-12-13	Sebastian Huber <sebastian.huber at embedded-brains.de>

	* score/include/rtems/score/wkspace.h, score/src/wkstringduplicate.c:
	Changed parameter of _Workspace_String_duplicate() to avoid strnlen().

M 1.3088  cpukit/ChangeLog
M   1.35  cpukit/score/include/rtems/score/wkspace.h
M    1.2  cpukit/score/src/wkstringduplicate.c

diff -u rtems/cpukit/ChangeLog:1.3087 rtems/cpukit/ChangeLog:1.3088
--- rtems/cpukit/ChangeLog:1.3087	Tue Dec 13 00:47:21 2011
+++ rtems/cpukit/ChangeLog	Tue Dec 13 04:06:53 2011
@@ -1,3 +1,8 @@
+2011-12-13	Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+	* score/include/rtems/score/wkspace.h, score/src/wkstringduplicate.c:
+	Changed parameter of _Workspace_String_duplicate() to avoid strnlen().
+
 2011-12-13	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	* configure.ac: Check for getrusage.h decl.

diff -u rtems/cpukit/score/include/rtems/score/wkspace.h:1.34 rtems/cpukit/score/include/rtems/score/wkspace.h:1.35
--- rtems/cpukit/score/include/rtems/score/wkspace.h:1.34	Mon Dec 12 09:17:33 2011
+++ rtems/cpukit/score/include/rtems/score/wkspace.h	Tue Dec 13 04:06:53 2011
@@ -102,18 +102,15 @@
 /**
  * @brief Duplicates the @a string with memory from the Workspace.
  *
- * If the @a string length exceeds @a maxlen, then the additional characters
- * will be discarded.
- *
  * @param[in] string Pointer to zero terminated string.
- * @param[in] maxlen Maximum length of the duplicated string.
+ * @param[in] len Length of the string (equal to strlen(string)).
  *
  * @return NULL Not enough memory.
  * @return other Duplicated string.
  */
 char *_Workspace_String_duplicate(
   const char *string,
-  size_t maxlen
+  size_t len
 );
 
 #ifndef __RTEMS_APPLICATION__

diff -u rtems/cpukit/score/src/wkstringduplicate.c:1.1 rtems/cpukit/score/src/wkstringduplicate.c:1.2
--- rtems/cpukit/score/src/wkstringduplicate.c:1.1	Mon Dec 12 09:17:33 2011
+++ rtems/cpukit/score/src/wkstringduplicate.c	Tue Dec 13 04:06:53 2011
@@ -24,15 +24,14 @@
 
 char *_Workspace_String_duplicate(
   const char *string,
-  size_t maxlen
+  size_t len
 )
 {
-  size_t n = strnlen(string, maxlen);
-  char *dup = _Workspace_Allocate(n + 1);
+  char *dup = _Workspace_Allocate(len + 1);
 
   if (dup != NULL) {
-    dup [n] = '\0';
-    memcpy(dup, string, n);
+    dup [len] = '\0';
+    memcpy(dup, string, len);
   }
 
   return dup;


 *ralf*:
2011-12-13	Ralf Corsépius <ralf.corsepius at rtems.org>

	* tm30/init.c: Make benchmark_barrier_create,
	benchmark_barrier_ident, benchmark_barrier_delete static.

M  1.104  testsuites/tmtests/ChangeLog
M    1.3  testsuites/tmtests/tm30/init.c

diff -u rtems/testsuites/tmtests/ChangeLog:1.103 rtems/testsuites/tmtests/ChangeLog:1.104
--- rtems/testsuites/tmtests/ChangeLog:1.103	Thu Dec  8 15:38:45 2011
+++ rtems/testsuites/tmtests/ChangeLog	Tue Dec 13 03:54:50 2011
@@ -1,3 +1,8 @@
+2011-12-13	Ralf Corsépius <ralf.corsepius at rtems.org>
+
+	* tm30/init.c: Make benchmark_barrier_create,
+	benchmark_barrier_ident, benchmark_barrier_delete static.
+
 2011-12-08	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	PR 1589/build

diff -u rtems/testsuites/tmtests/tm30/init.c:1.2 rtems/testsuites/tmtests/tm30/init.c:1.3
--- rtems/testsuites/tmtests/tm30/init.c:1.2	Tue Feb 22 03:57:14 2011
+++ rtems/testsuites/tmtests/tm30/init.c	Tue Dec 13 03:54:51 2011
@@ -21,7 +21,7 @@
 
 rtems_id barrier[ OPERATION_COUNT ];
 
-void benchmark_barrier_create(
+static void benchmark_barrier_create(
   int    iteration,
   void  *argument
 )
@@ -37,7 +37,7 @@
   directive_failed(status, "rtems_barrier_create");
 }
 
-void benchmark_barrier_ident(
+static void benchmark_barrier_ident(
   int    iteration,
   void  *argument
 )
@@ -49,7 +49,7 @@
   directive_failed(status, "rtems_barrier_ident");
 }
 
-void benchmark_barrier_delete(
+static void benchmark_barrier_delete(
   int    iteration,
   void  *argument
 )


 *ralf*:
2011-12-13	Ralf Corsépius <ralf.corsepius at rtems.org>

	* sp31/task1.c: Make Do_nothing static.
	* sprbtree01/init.c: Make test_compare_function, rb_assert static.

M  1.503  testsuites/sptests/ChangeLog
M   1.19  testsuites/sptests/sp31/task1.c
M    1.9  testsuites/sptests/sprbtree01/init.c

diff -u rtems/testsuites/sptests/ChangeLog:1.502 rtems/testsuites/sptests/ChangeLog:1.503
--- rtems/testsuites/sptests/ChangeLog:1.502	Mon Dec 12 09:18:18 2011
+++ rtems/testsuites/sptests/ChangeLog	Tue Dec 13 04:02:30 2011
@@ -1,3 +1,8 @@
+2011-12-13	Ralf Corsépius <ralf.corsepius at rtems.org>
+
+	* sp31/task1.c: Make Do_nothing static.
+	* sprbtree01/init.c: Make test_compare_function, rb_assert static.
+
 2011-12-12	Sebastian Huber <sebastian.huber at embedded-brains.de>
 
 	* spwkspace/init.c: Test _Workspace_String_duplicate().

diff -u rtems/testsuites/sptests/sp31/task1.c:1.18 rtems/testsuites/sptests/sp31/task1.c:1.19
--- rtems/testsuites/sptests/sp31/task1.c:1.18	Sun Jul 24 17:10:18 2011
+++ rtems/testsuites/sptests/sp31/task1.c	Tue Dec 13 04:02:30 2011
@@ -32,7 +32,7 @@
   TSR_fired = 1;
 }
 
-rtems_timer_service_routine Do_nothing(
+static rtems_timer_service_routine Do_nothing(
   rtems_id  ignored_id,
   void     *ignored_address
 )

diff -u rtems/testsuites/sptests/sprbtree01/init.c:1.8 rtems/testsuites/sptests/sprbtree01/init.c:1.9
--- rtems/testsuites/sptests/sprbtree01/init.c:1.8	Thu Sep 29 11:20:49 2011
+++ rtems/testsuites/sptests/sprbtree01/init.c	Tue Dec 13 04:02:30 2011
@@ -27,7 +27,7 @@
   rtems_rbtree_node Node;
 } test_node;
 
-int test_compare_function (
+static int test_compare_function (
   rtems_rbtree_node* n1,
   rtems_rbtree_node* n2
 )
@@ -44,7 +44,7 @@
  * recursively checks tree. if the tree is built properly it should only 
  * be a depth of 7 function calls for 100 entries in the tree. 
  */
-int rb_assert ( rtems_rbtree_node *root )
+static int rb_assert ( rtems_rbtree_node *root )
 {
   int lh, rh;
 



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20111213/3b5d3328/attachment-0001.html>


More information about the vc mailing list