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

4.104.114.84.95
Last change on this file since df49c60 was df49c60, checked in by Joel Sherrill <joel.sherrill@…>, on 06/12/00 at 15:00:15

Merged from 4.5.0-beta3a

  • Property mode set to 100644
File size: 917 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.OARcorp.com/rtems/license.html.
18 *
19 *  $Id$
20 */
21
22#include "system.h"
23
24#define MESSAGE_SIZE (sizeof(long) * 4)
25
26void Fill_buffer(
27  char *source,
28  long *buffer
29)
30{
31  char *p;
32  int i;
33/*
34  memcpy( buffer, source, 16 );
35*/
36  p = source;
37  for ( i=0 ; i<MESSAGE_SIZE ; i++ ) {
38    buffer[i] = *p++;
39    buffer[i] <<= 8;
40    buffer[i] |= *p++;
41    buffer[i] <<= 8;
42    buffer[i] |= *p++;
43    buffer[i] <<= 8;
44    buffer[i] |= *p++;
45  }
46}
Note: See TracBrowser for help on using the repository browser.