source: rtems/testsuites/sptests/sp13/fillbuff.c

Last change on this file was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 848 bytes
Line 
1/*  Fill_buffer
2 *
3 *  This test routine copies a given source string to a given destination
4 *  buffer.
5 *
6 *  Input parameters:
7 *    source - pointer to string to be copied
8 *    buffer - pointer to message buffer to be filled
9 *
10 *  Output parameters:  NONE
11 *
12 *  COPYRIGHT (c) 1989-1999.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#ifdef HAVE_CONFIG_H
21#include "config.h"
22#endif
23
24#include "system.h"
25
26void Fill_buffer(
27  char *source,
28  long *buffer
29)
30{
31  char *p;
32  int i, j;
33
34  p = source;
35  for ( i = 0 ; i < MESSAGE_SIZE / sizeof(long) ; i++ ) {
36    buffer[i] = 0;
37    for ( j = sizeof(long) - 1; j >= 0; j-- ) {
38      buffer[i] |= *p++ << (8 * j);
39    }
40  }
41}
Note: See TracBrowser for help on using the repository browser.