[tracker/dbus-fd-experiment] libtracker-client/tracker-store: Use same endian'ness
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/dbus-fd-experiment] libtracker-client/tracker-store: Use same endian'ness
- Date: Tue, 22 Jun 2010 15:01:39 +0000 (UTC)
commit 0b3adf34fa0e8bba3fea9c2475017ecc86d1e703
Author: Martyn Russell <martyn lanedo com>
Date: Tue Jun 22 16:00:58 2010 +0100
libtracker-client/tracker-store: Use same endian'ness
Fixes a crash only seen in some cases
src/libtracker-client/tracker.c | 4 +---
src/tracker-store/tracker-steroids.c | 1 +
2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-client/tracker.c b/src/libtracker-client/tracker.c
index 7396cb7..fc444d5 100644
--- a/src/libtracker-client/tracker.c
+++ b/src/libtracker-client/tracker.c
@@ -582,7 +582,7 @@ iterator_buffer_read_int (TrackerResultIterator *iterator)
iterator->buffer_index += 4;
- return GINT32_FROM_BE (v);
+ return v;
}
static void
@@ -1924,8 +1924,6 @@ tracker_result_iterator_next (TrackerResultIterator *iterator)
* iteration = [4 bytes for number of columns,
* 4 bytes for last offset]
*/
-
-
iterator->n_columns = iterator_buffer_read_int (iterator);
iterator->offsets = (int *)(iterator->buffer + iterator->buffer_index);
iterator->buffer_index += sizeof (int) * (iterator->n_columns - 1);
diff --git a/src/tracker-store/tracker-steroids.c b/src/tracker-store/tracker-steroids.c
index a4f4027..670ad8d 100644
--- a/src/tracker-store/tracker-steroids.c
+++ b/src/tracker-store/tracker-steroids.c
@@ -252,6 +252,7 @@ query_inthread (TrackerDBCursor *cursor,
output_stream = g_buffered_output_stream_new_sized (unix_output_stream,
TRACKER_STEROIDS_BUFFER_SIZE);
data_output_stream = g_data_output_stream_new (output_stream);
+ g_data_output_stream_set_byte_order (data_output_stream, G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN);
if (error) {
g_object_unref (data_output_stream);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]