summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-28 03:42:36 +0000
committerDavid Robillard <d@drobilla.net>2011-04-28 03:42:36 +0000
commit688537cf5ccb709c23359eb855946bedd5b65fcf (patch)
tree6a690c182bcd11e7d85b5993c21b473b16470ee7
parentb9fae06dc9459b7d3b87c561434ddc2ced821f87 (diff)
downloadsord-688537cf5ccb709c23359eb855946bedd5b65fcf.tar.gz
sord-688537cf5ccb709c23359eb855946bedd5b65fcf.tar.bz2
sord-688537cf5ccb709c23359eb855946bedd5b65fcf.zip
Use size_t for node and triple counts.
git-svn-id: http://svn.drobilla.net/sord/trunk@97 3d64ff67-21c5-427c-a301-fe4f08042e5a
-rw-r--r--sord/sord.h4
-rw-r--r--src/sord.c10
-rw-r--r--src/sord_internal.h4
-rw-r--r--src/sordi.c2
4 files changed, 9 insertions, 11 deletions
diff --git a/sord/sord.h b/sord/sord.h
index 530247e..587456b 100644
--- a/sord/sord.h
+++ b/sord/sord.h
@@ -317,14 +317,14 @@ sord_get_world(SordModel* model);
Nodes are included in this count iff they are a part of a quad in @c world.
*/
SORD_API
-int
+size_t
sord_num_nodes(const SordWorld* world);
/**
Return the number of quads stored in @c model.
*/
SORD_API
-int
+size_t
sord_num_quads(const SordModel* model);
/**
diff --git a/src/sord.c b/src/sord.c
index d97a5c7..ff449ee 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -101,7 +101,7 @@ struct SordWorldImpl {
GHashTable* names; ///< URI or blank node identifier string => ID
GHashTable* langs; ///< Language tag => Interned language tag
GHashTable* literals; ///< Literal => ID
- SordCount n_nodes; ///< Number of nodes
+ size_t n_nodes; ///< Number of nodes
};
/** Store */
@@ -114,7 +114,7 @@ struct SordModelImpl {
*/
GSequence* indices[NUM_ORDERS];
- SordCount n_quads;
+ size_t n_quads;
};
/** Mode for searching or iteration */
@@ -632,13 +632,13 @@ sord_get_world(SordModel* sord)
return sord->world;
}
-int
+size_t
sord_num_quads(const SordModel* sord)
{
return sord->n_quads;
}
-int
+size_t
sord_num_nodes(const SordWorld* world)
{
return world->n_nodes;
@@ -1010,7 +1010,7 @@ sord_add(SordModel* sord, const SordQuad tup)
sord_add_quad_ref(sord, tup[i]);
++sord->n_quads;
- assert(sord->n_quads == g_sequence_get_length(sord->indices[SPO]));
+ assert(sord->n_quads == (size_t)g_sequence_get_length(sord->indices[SPO]));
return true;
}
diff --git a/src/sord_internal.h b/src/sord_internal.h
index 567b56c..e4d858b 100644
--- a/src/sord_internal.h
+++ b/src/sord_internal.h
@@ -22,15 +22,13 @@
#include "sord/sord.h"
-typedef intptr_t SordCount; ///< Count of nodes or triples
-
/** Node */
struct SordNodeImpl {
uint8_t* buf; ///< Value (string)
const char* lang; ///< Literal language (interned string)
SordNode* datatype; ///< Literal data type (ID of a URI node, or 0)
size_t n_bytes; ///< Length of data in bytes (including terminator)
- SordCount refs; ///< Reference count (i.e. number of containing quads)
+ size_t refs; ///< Reference count (i.e. number of containing quads)
SordNodeType type; ///< SordNodeType
};
diff --git a/src/sordi.c b/src/sordi.c
index dfcb85a..3451935 100644
--- a/src/sordi.c
+++ b/src/sordi.c
@@ -121,7 +121,7 @@ main(int argc, char** argv)
bool success = sord_read_file(sord, input, NULL, NULL);
- printf("loaded %u statements\n", sord_num_nodes(world));
+ printf("loaded %zu statements\n", sord_num_nodes(world));
SerdURI base_uri;
if (!serd_uri_parse(input, &base_uri)) {