projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a warning
[lttv.git]
/
lttv
/
lttv
/
sync
/
data_structures.c
diff --git
a/lttv/lttv/sync/data_structures.c
b/lttv/lttv/sync/data_structures.c
index c4d4d966f31025db80058b69bfadb4762411f8ef..a8cc337ba091413b6328f023dda24edf6c50b84e 100644
(file)
--- a/
lttv/lttv/sync/data_structures.c
+++ b/
lttv/lttv/sync/data_structures.c
@@
-1,19
+1,18
@@
/* This file is part of the Linux Trace Toolkit viewer
/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
+ * Copyright (C) 2009
, 2010
Benjamin Poirier <benjamin.poirier@polymtl.ca>
*
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 2.1 of the License, or (at
+ * your option) any later version.
*
*
- * This program is distributed in the hope that it will be useful,
- *
but WITHOUT ANY WARRANTY; without even the implied warranty of
- *
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *
GNU General Public
License for more details.
+ * This program is distributed in the hope that it will be useful,
but WITHOUT
+ *
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ *
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
*
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
*/
#ifdef HAVE_CONFIG_H
@@
-34,10
+33,6
@@
#include "data_structures.h"
#include "data_structures.h"
-#ifndef g_info
-#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
-#endif
-
// TCP sequence numbers use clock arithmetic, these comparison functions take
// that into account
#define SEQ_LT(a,b) ((int32_t)((a)-(b)) < 0)
// TCP sequence numbers use clock arithmetic, these comparison functions take
// that into account
#define SEQ_LT(a,b) ((int32_t)((a)-(b)) < 0)
@@
-238,8
+233,6
@@
void gdnTCPSegmentListDestroy(gpointer data)
list= (GQueue*) data;
list= (GQueue*) data;
- g_debug("XXXX gdnTCPSegmentListDestroy\n");
-
g_queue_foreach(list, &gfTCPSegmentDestroy, NULL);
g_queue_free(list);
}
g_queue_foreach(list, &gfTCPSegmentDestroy, NULL);
g_queue_free(list);
}
@@
-254,7
+247,6
@@
void gdnTCPSegmentListDestroy(gpointer data)
*/
void gfTCPSegmentDestroy(gpointer data, gpointer user_data)
{
*/
void gfTCPSegmentDestroy(gpointer data, gpointer user_data)
{
- g_debug("XXXX gfTCPSegmentDestroy\n");
destroyTCPSegment((Message*) data);
}
destroyTCPSegment((Message*) data);
}
@@
-270,7
+262,6
@@
void destroyTCPSegment(Message* const segment)
{
TCPEvent* inE, *outE;
{
TCPEvent* inE, *outE;
- g_debug("XXXX destroyTCPSegment");
segment->print(segment);
g_assert(segment->inE != NULL && segment->outE != NULL);
segment->print(segment);
g_assert(segment->inE != NULL && segment->outE != NULL);
@@
-462,9
+453,14
@@
void gdnConnectionKeyDestroy(gpointer data)
guint ghfDatagramKeyHash(gconstpointer key)
{
DatagramKey* datagramKey;
guint ghfDatagramKeyHash(gconstpointer key)
{
DatagramKey* datagramKey;
+ union {
+ uint8_t byteKey[8];
+ uint32_t hashableKey[2];
+ } dataKey;
uint32_t a, b, c;
datagramKey= (DatagramKey*) key;
uint32_t a, b, c;
datagramKey= (DatagramKey*) key;
+ memcpy(dataKey.byteKey, datagramKey->dataKey, sizeof(dataKey.byteKey));
a= datagramKey->saddr;
b= datagramKey->daddr;
a= datagramKey->saddr;
b= datagramKey->daddr;
@@
-472,8
+468,8
@@
guint ghfDatagramKeyHash(gconstpointer key)
mix(a, b, c);
a+= datagramKey->ulen; // 16 bits left here
mix(a, b, c);
a+= datagramKey->ulen; // 16 bits left here
- b+=
*((uint32_t*) datagramKey->dataKey)
;
- c+=
*((uint32_t*) ((void*) datagramKey->dataKey + 4))
;
+ b+=
dataKey.hashableKey[0]
;
+ c+=
dataKey.hashableKey[1]
;
final(a, b, c);
return c;
final(a, b, c);
return c;
@@
-640,3
+636,16
@@
void copyUDPEvent(const Event* const event, Event** const newEvent)
memcpy((*newEvent)->event.udpEvent->datagramKey,
event->event.udpEvent->datagramKey, sizeof(DatagramKey));
}
memcpy((*newEvent)->event.udpEvent->datagramKey,
event->event.udpEvent->datagramKey, sizeof(DatagramKey));
}
+
+
+/*
+ * A GFunc for g_queue_foreach()
+ *
+ * Args:
+ * data Event*, event to add
+ * user_data GArray*, array to add to
+ */
+void gfAddEventToArray(gpointer data, gpointer user_data)
+{
+ g_array_append_val((GArray*) user_data, data);
+}
This page took
0.024951 seconds
and
4
git commands to generate.