Permalink
Browse files

native: Use size_t instead of int where appropriate

  • Loading branch information...
illdefined committed Feb 12, 2012
1 parent a932b5c commit 6dc7fa87b6713bde0a5d1cd17c4b0fdc3f6fcfdf
Showing with 17 additions and 16 deletions.
  1. +6 −6 src/cc_item.h
  2. +1 −1 src/cosine.c
  3. +1 −1 src/cosine.h
  4. +2 −2 src/jaccard.c
  5. +1 −1 src/jaccard.h
  6. +6 −5 src/recommendify.c
View
@@ -3,11 +3,11 @@
#define ITEM_ID_SIZE 64
-struct cc_item {
- char item_id[ITEM_ID_SIZE];
- int coconcurrency_count;
- int total_count;
- float similarity;
-};
+struct cc_item {
+ char item_id[ITEM_ID_SIZE];
+ size_t coconcurrency_count;
+ size_t total_count;
+ float similarity;
+};
#endif
View
@@ -2,6 +2,6 @@
#include "cc_item.h"
-void calculate_cosine(char const *restrict item_id, int itemCount, struct cc_item *restrict cc_items, int cc_items_size){
+void calculate_cosine(char const *restrict item_id, size_t itemCount, struct cc_item *restrict cc_items, size_t cc_items_size){
/* here be dragons */
}
View
@@ -3,6 +3,6 @@
#include "cc_item.h"
-void calculate_cosine(char const *restrict item_id, int itemCount, struct cc_item *restrict cc_items, int cc_items_size);
+void calculate_cosine(char const *restrict item_id, size_t itemCount, struct cc_item *restrict cc_items, size_t cc_items_size);
#endif
View
@@ -2,8 +2,8 @@
#include "cc_item.h"
-void calculate_jaccard(char const *restrict item_id, int itemCount, struct cc_item *restrict cc_items, int cc_items_size){
- int j, n;
+void calculate_jaccard(char const *restrict item_id, size_t itemCount, struct cc_item *restrict cc_items, size_t cc_items_size){
+ size_t j, n;
for(j = 0; j < cc_items_size; j++){
n = cc_items[j].coconcurrency_count;
View
@@ -3,6 +3,6 @@
#include "cc_item.h"
-void calculate_jaccard(char const *restrict item_id, int itemCount, struct cc_item *restrict cc_items, int cc_items_size);
+void calculate_jaccard(char const *restrict item_id, size_t itemCount, struct cc_item *restrict cc_items, size_t cc_items_size);
#endif
View
@@ -10,19 +10,20 @@
#include "output.h"
int main(int argc, char **argv){
- int i, j, n, similarityFunc = 0;
- int itemCount = 0;
+ size_t i, j, n;
+ int similarityFunc = 0;
+ size_t itemCount = 0;
char *itemID;
char *redisPrefix;
redisContext *c;
redisReply *all_items;
redisReply *reply;
- int cur_batch_size;
+ size_t cur_batch_size;
char* cur_batch;
char *iikey;
- int batch_size = 200; /* FIXPAUL: make option */
- int maxItems = 50; /* FIXPAUL: make option */
+ size_t batch_size = 200; /* FIXPAUL: make option */
+ size_t maxItems = 50; /* FIXPAUL: make option */
/* option parsing */

0 comments on commit 6dc7fa8

Please sign in to comment.