Skip to content

Commit 3912305

Browse files
committed
Remove last warning; use \r not 13
1 parent d7b2710 commit 3912305

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CC = gcc
22
#For older gcc, use -O3 or -O2 instead of -Ofast
3-
CFLAGS = -lm -pthread -Ofast -march=native -funroll-loops -Wno-unused-result
3+
# CFLAGS = -lm -pthread -Ofast -march=native -funroll-loops -Wno-unused-result
4+
CFLAGS = -lm -pthread -Ofast -march=native -funroll-loops -Wall -Wextra -Wpedantic
45
BUILDDIR := build
56
SRCDIR := src
67

src/cooccur.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Tool to calculate word-word cooccurrence statistics
22
//
3-
// Copyright (c) 2014 The Board of Trustees of
3+
// Copyright (c) 2014, 2018 The Board of Trustees of
44
// The Leland Stanford Junior University. All Rights Reserved.
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,9 +28,10 @@
2828

2929
#define TSIZE 1048576
3030
#define SEED 1159241
31+
#define MAX_STRING_LENGTH 1000
32+
3133
#define HASHFN bitwisehash
3234

33-
static const int MAX_STRING_LENGTH = 1000;
3435
typedef double real;
3536

3637
typedef struct cooccur_rec {
@@ -122,7 +123,7 @@ int get_word(char *word, FILE *fin) {
122123
int i = 0, ch;
123124
while (!feof(fin)) {
124125
ch = fgetc(fin);
125-
if (ch == 13) continue;
126+
if (ch == '\r') continue;
126127
if ((ch == ' ') || (ch == '\t') || (ch == '\n')) {
127128
if (i > 0) {
128129
if (ch == '\n') ungetc(ch, fin);

src/vocab_count.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define MAX_STRING_LENGTH 1000
3030
#define TSIZE 1048576
3131
#define SEED 1159241
32+
3233
#define HASHFN bitwisehash
3334

3435
typedef struct vocabulary {

0 commit comments

Comments
 (0)