Commit c090a7dc authored by Niels Möller's avatar Niels Möller
Browse files

General cleanup. Use types uint32_t and friends instead of

UINT32. Include files in the order config.h, C headers, system
headers, lsh headers. Deleted RCS id strings. Affects most files.

Rev: src/rsync/checksum.c:1.5
Rev: src/rsync/generate.c:1.7
Rev: src/rsync/receive.c:1.7
Rev: src/rsync/rsync.h:1.8
Rev: src/rsync/send.c:1.9
parent 7d6cb48b
......@@ -2,7 +2,6 @@
*
* Calculate rsync specific checksums.
*
* $Id$
*/
#include "rsync.h"
......@@ -29,11 +28,11 @@
void
rsync_update_1(unsigned *ap, unsigned *cp,
UINT32 length, UINT8 *data)
uint32_t length, uint8_t *data)
{
unsigned a = *ap;
unsigned c = *cp;
UINT32 i;
uint32_t i;
for (i = 0; i<length; i++)
{
......@@ -59,12 +58,12 @@ rsync_update_1(unsigned *ap, unsigned *cp,
struct rsync_node *
rsync_search(unsigned *ap, unsigned *bp, unsigned block_size,
UINT32 length, UINT8 *start, UINT8 *end,
UINT32 *done, struct rsync_node **hash)
uint32_t length, uint8_t *start, uint8_t *end,
uint32_t *done, struct rsync_node **hash)
{
unsigned a = *ap;
unsigned b = *bp;
UINT32 i;
uint32_t i;
struct rsync_node *n;
#if 0
......
......@@ -2,14 +2,19 @@
*
* Generate the list of checksums.
*
* $Id$
*/
#include "rsync.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <string.h>
#include <nettle/macros.h>
#include "rsync.h"
static void
rsync_init_block(struct rsync_generate_state *s)
{
......
......@@ -2,17 +2,21 @@
*
* The receive end of the rsync algorithm.
*
* $Id$ */
#include "rsync.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <string.h>
#include "rsync.h"
#include "macros.h"
/* Hash the data after it is copied to the output buffer. */
static void
rsync_update(struct rsync_receive_state *s,
UINT32 length)
uint32_t length)
{
md5_update(&s->sum_md5, length, s->next_out);
s->next_out += length;
......@@ -68,7 +72,7 @@ rsync_receive(struct rsync_receive_state *s)
s->state = RSYNC_READ_LITERAL;
case RSYNC_READ_LITERAL:
{
UINT32 avail = MIN(s->avail_in, s->avail_out);
uint32_t avail = MIN(s->avail_in, s->avail_out);
if (!avail)
return progress ? RSYNC_PROGRESS : RSYNC_BUF_ERROR;
......@@ -96,7 +100,7 @@ rsync_receive(struct rsync_receive_state *s)
s->i = 0;
case RSYNC_READ_LOOKUP:
{
UINT32 done;
uint32_t done;
if (!s->avail_out)
return progress ? RSYNC_PROGRESS : RSYNC_BUF_ERROR;
......
/* rsync.h
*
* $Id$
*/
/*
......@@ -26,14 +25,6 @@
#ifndef RSYNC_H_INCLUDED
#define RSYNC_H_INCLUDED
#if LSH
# include "lsh_types.h"
#else
# if HAVE_CONFIG_H
# include "config.h"
# endif
#endif
#include <inttypes.h>
#include <nettle/md5.h>
......
......@@ -2,13 +2,20 @@
*
* The sending end of the rsync algorithm.
*
* $Id$ */
*/
#include "rsync.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <string.h>
#include <nettle/macros.h>
#include "rsync.h"
#include "macros.h"
#define HASH_SIZE 0x10000
#define HASH_SUM(a, b) (((a) ^ (b)) & 0xffff)
#define COMBINE_SUM(a, b) ((a) | ((b) << 16))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment