OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [newlib/] [newlib/] [newlib/] [libc/] [string/] [strncat.c] - Diff between revs 39 and 56

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 39 Rev 56
Line 45... Line 45...
#include <string.h>
#include <string.h>
#include <limits.h>
#include <limits.h>
 
 
/* Nonzero if X is aligned on a "long" boundary.  */
/* Nonzero if X is aligned on a "long" boundary.  */
#define ALIGNED(X) \
#define ALIGNED(X) \
  (((long)X & (sizeof (long) - 1)))
  (((long)X & (sizeof (long) - 1)) == 0)
 
 
#if LONG_MAX == 2147483647L
#if LONG_MAX == 2147483647L
#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
#else
#else
#if LONG_MAX == 9223372036854775807L
#if LONG_MAX == 9223372036854775807L
Line 68... Line 68...
_DEFUN (strncat, (s1, s2, n),
_DEFUN (strncat, (s1, s2, n),
        char *s1 _AND
        char *s1 _AND
        _CONST char *s2 _AND
        _CONST char *s2 _AND
        size_t n)
        size_t n)
{
{
#ifdef PREFER_SIZE_OVER_SPEED
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
  char *s = s1;
  char *s = s1;
 
 
  while (*s1)
  while (*s1)
    s1++;
    s1++;
  while (n-- != 0 && (*s1++ = *s2++))
  while (n-- != 0 && (*s1++ = *s2++))

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.