[xrock]update some code

This commit is contained in:
JianjunJiang 2021-08-04 11:33:41 +08:00
parent e2b7d851b7
commit 7484c825de
4 changed files with 4 additions and 2 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
*.d
*.o
*.map
*.exe
*~
#

2
main.c
View File

@ -57,7 +57,7 @@ static void hexdump(uint32_t addr, void * buf, size_t len)
for(j = 0; j < len; j += 16)
{
printf("%08zx: ", addr + j);
printf("%08x: ", (uint32_t)(addr + j));
for(i = 0; i < 16; i++)
{
if(j + i < len)

2
rock.c
View File

@ -224,7 +224,7 @@ static inline uint32_t make_tag(void)
int i;
for(i = 0; i < 4; i++)
tag = (tag << 8) | (random() & 0xff);
tag = (tag << 8) | (rand() & 0xff);
return tag;
}

1
x.h
View File

@ -15,6 +15,7 @@ extern "C" {
#elif defined(__WINDOWS__)
# include <winsock2.h>
# include <sys/param.h>
# include <sys/time.h>
#else
# error "platform not supported!"
#endif