Skip to content

Commit

Permalink
Gave the byte_* functions proper prototypes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceg committed Jan 4, 2005
1 parent ea6a866 commit f808ac8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 34 deletions.
12 changes: 6 additions & 6 deletions byte.h
Expand Up @@ -3,12 +3,12 @@
#ifndef BYTE_H
#define BYTE_H

extern unsigned int byte_chr();
extern unsigned int byte_rchr();
extern void byte_copy();
extern void byte_copyr();
extern int byte_diff();
extern void byte_zero();
extern unsigned int byte_chr(const char *s,unsigned int n,int c);
extern unsigned int byte_rchr(const char *s,unsigned int n,int c);
extern void byte_copy(char *to,unsigned int n,const char *from);
extern void byte_copyr(char *to,unsigned int n,const char *from);
extern int byte_diff(const char *s,unsigned int n,const char *t);
extern void byte_zero(char *s,unsigned int n);

#define byte_equal(s,n,t) (!byte_diff((s),(n),(t)))

Expand Down
9 changes: 3 additions & 6 deletions byte_chr.c
Expand Up @@ -2,13 +2,10 @@

#include "byte.h"

unsigned int byte_chr(s,n,c)
char *s;
register unsigned int n;
int c;
unsigned int byte_chr(const char *s,unsigned int n,int c)
{
register char ch;
register char *t;
char ch;
const char *t;

ch = c;
t = s;
Expand Down
5 changes: 1 addition & 4 deletions byte_copy.c
Expand Up @@ -2,10 +2,7 @@

#include "byte.h"

void byte_copy(to,n,from)
register char *to;
register unsigned int n;
register char *from;
void byte_copy(char *to,unsigned int n,const char *from)
{
for (;;) {
if (!n) return; *to++ = *from++; --n;
Expand Down
5 changes: 1 addition & 4 deletions byte_cr.c
Expand Up @@ -2,10 +2,7 @@

#include "byte.h"

void byte_copyr(to,n,from)
register char *to;
register unsigned int n;
register char *from;
void byte_copyr(char *to,unsigned int n,const char *from)
{
to += n;
from += n;
Expand Down
5 changes: 1 addition & 4 deletions byte_diff.c
Expand Up @@ -2,10 +2,7 @@

#include "byte.h"

int byte_diff(s,n,t)
register char *s;
register unsigned int n;
register char *t;
int byte_diff(const char *s,unsigned int n,const char *t)
{
for (;;) {
if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
Expand Down
11 changes: 4 additions & 7 deletions byte_rchr.c
Expand Up @@ -2,14 +2,11 @@

#include "byte.h"

unsigned int byte_rchr(s,n,c)
char *s;
register unsigned int n;
int c;
unsigned int byte_rchr(const char *s,unsigned int n,int c)
{
register char ch;
register char *t;
register char *u;
char ch;
const char *t;
const char *u;

ch = c;
t = s;
Expand Down
4 changes: 1 addition & 3 deletions byte_zero.c
Expand Up @@ -3,9 +3,7 @@

#include "byte.h"

void byte_zero(s,n)
char *s;
register unsigned int n;
void byte_zero(char *s,unsigned int n)
{
for (;;) {
if (!n) break; *s++ = 0; --n;
Expand Down

0 comments on commit f808ac8

Please sign in to comment.