Skip to content

Commit

Permalink
use pragma once instead of include guard, it's been
Browse files Browse the repository at this point in the history
widely supported by almost all compilers.

ref: https://www.wikiwand.com/en/Pragma_once
  • Loading branch information
tonytonyjan committed Mar 18, 2016
1 parent 9a67fc5 commit 2d7f43e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions ext/jaro_winkler/adj_matrix.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef ADJ_MATRIX_H
#define ADJ_MATRIX_H
#pragma once
#define ADJ_MATRIX_DEFAULT_LENGTH 958
#define ADJ_MATRIX_SEED 9527

Expand All @@ -17,6 +16,4 @@ AdjMatrix* adj_matrix_new (unsigned int length);
void adj_matrix_add (AdjMatrix *matrix, unsigned long long x, unsigned long long y);
char adj_matrix_find (AdjMatrix *matrix, unsigned long long x, unsigned long long y);
void adj_matrix_free (AdjMatrix *matrix);
AdjMatrix* adj_matrix_default();

#endif
AdjMatrix* adj_matrix_default();
7 changes: 2 additions & 5 deletions ext/jaro_winkler/code.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#ifndef CODE_H
#define CODE_H
#pragma once

void utf_char_to_code(char *str, unsigned long long *ret_code, int *ret_byte_length);
void string_to_codes(char *str, int length, unsigned long long **ret_codes, int *ret_length);

#endif
void string_to_codes(char *str, int length, unsigned long long **ret_codes, int *ret_length);
7 changes: 2 additions & 5 deletions ext/jaro_winkler/jaro.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef LIBJARO_JARO_H
#define LIBJARO_JARO_H
#pragma once

#define DEFAULT_WEIGHT 0.1
#define DEFAULT_THRESHOLD 0.7
Expand All @@ -12,6 +11,4 @@ typedef struct LibJaroOption{

static const LibJaroOption DEFAULT_OPT = {.weight = DEFAULT_WEIGHT, .threshold = DEFAULT_THRESHOLD, .ignore_case = 0, .adj_table = 0};
double jaro_distance(char *str1, int len1, char *str2, int len2, LibJaroOption *opt);
double jaro_winkler_distance(char *str1, int len1, char *str2, int len2, LibJaroOption *opt);

#endif
double jaro_winkler_distance(char *str1, int len1, char *str2, int len2, LibJaroOption *opt);

0 comments on commit 2d7f43e

Please sign in to comment.