Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
d2a6b3ef
Commit
d2a6b3ef
authored
17 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Backed-out some unnecessary ulong -> uint32_t conversions.
parent
8f2564bc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/hash/crc16.c
+2
-2
2 additions, 2 deletions
src/hash/crc16.c
src/hash/crc32.c
+5
-4
5 additions, 4 deletions
src/hash/crc32.c
with
7 additions
and
6 deletions
src/hash/crc16.c
+
2
−
2
View file @
d2a6b3ef
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
3
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
7
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -76,7 +76,7 @@ uint16_t crc16tbl[] = {
uint16_t
crc16
(
char
*
data
,
unsigned
long
len
)
{
uint16_t
crc
=
0
;
u
int32_t
l
;
u
nsigned
long
l
;
if
(
len
==
0
&&
data
!=
NULL
)
len
=
strlen
(
data
);
...
...
This diff is collapsed.
Click to expand it.
src/hash/crc32.c
+
5
−
4
View file @
d2a6b3ef
/* crc32.c */
/* 32-bit CRC table */
/*
IEEE 802.3
32-bit CRC table
and convenience functions
*/
/* $Id$ */
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
0
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
7
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -80,7 +80,7 @@ int32_t crc32tbl[]={ /* CRC polynomial 0xedb88320 */
/****************************************************************************/
uint32_t
crc32i
(
uint32_t
crc
,
char
*
buf
,
unsigned
long
len
)
{
u
int32_t
l
;
u
nsigned
long
l
;
if
(
len
==
0
&&
buf
!=
NULL
)
len
=
strlen
(
buf
);
...
...
@@ -92,7 +92,8 @@ uint32_t crc32i(uint32_t crc, char *buf, unsigned long len)
uint32_t
fcrc32
(
FILE
*
fp
,
unsigned
long
len
)
{
int
ch
;
uint32_t
l
,
crc
=
0xffffffff
;
uint32_t
crc
=
0xffffffff
;
unsigned
long
l
;
rewind
(
fp
);
for
(
l
=
0
;(
len
==
0
||
l
<
len
)
&&
!
feof
(
fp
);
l
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment