summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2011-02-07 14:01:03 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2011-02-07 14:08:05 +0100
commit63d76f874270cbafb2cb13e5e261d0a7a1919f32 (patch)
tree29698d69429a92d373d4331ebb199a04c03a7a54
parent857745727daa36e46d5ad2b0239d89c60b47d65f (diff)
build failure (S360): size_t != unsigned int (BMC #13201)syncevolution-1-1-branch
SyncEvolution 1.1.1 did not build without this patch on S360, because the source used an integer typedef which turned out to be incompatible with size_t, although it should have the same size. Apparently the compiler distinguishes between "unsigned int" and "unsigned long", even if both have the same size.
-rw-r--r--src/syncevo/SyncSource.h15
-rw-r--r--src/syncevo/SynthesisDBPlugin.cpp15
2 files changed, 27 insertions, 3 deletions
diff --git a/src/syncevo/SyncSource.h b/src/syncevo/SyncSource.h
index f9053c8c..ccd3587e 100644
--- a/src/syncevo/SyncSource.h
+++ b/src/syncevo/SyncSource.h
@@ -1713,7 +1713,20 @@ class SyncSourceBlob : public virtual SyncSourceBase
void **aBlkPtr, size_t *aBlkSize,
size_t *aTotSize,
bool aFirst, bool *aLast) {
- return m_blob.ReadBlob(aID, aBlobID, aBlkPtr, aBlkSize, aTotSize, aFirst, aLast);
+ // Translate between sysync::memSize and size_t, which
+ // is different on s390 (or at least the compiler complains...).
+ sysync::memSize blksize, totsize;
+ sysync::TSyError err = m_blob.ReadBlob(aID, aBlobID, aBlkPtr,
+ aBlkSize ? &blksize : NULL,
+ aTotSize ? &totsize : NULL,
+ aFirst, aLast);
+ if (aBlkSize) {
+ *aBlkSize = blksize;
+ }
+ if (aTotSize) {
+ *aTotSize = totsize;
+ }
+ return err;
}
sysync::TSyError writeBlob(sysync::cItemID aID, const char *aBlobID,
void *aBlkPtr, size_t aBlkSize,
diff --git a/src/syncevo/SynthesisDBPlugin.cpp b/src/syncevo/SynthesisDBPlugin.cpp
index 089a6870..346e552d 100644
--- a/src/syncevo/SynthesisDBPlugin.cpp
+++ b/src/syncevo/SynthesisDBPlugin.cpp
@@ -721,8 +721,19 @@ sysync::TSyError SyncEvolution_ReadBlob(CContext aContext, cItemID aID, cAppCh
TSyError res;
if (source->getOperations().m_readBlob) {
try {
- res = source->getOperations().m_readBlob(aID, aBlobID, (void **)aBlkPtr, aBlkSize,
- aTotSize, aFirst, aLast);
+ size_t blksize, totsize;
+ /* Another conversion between memSize and size_t to make s390 happy */
+ res = source->getOperations().m_readBlob(aID, aBlobID, (void **)aBlkPtr,
+ aBlkSize ? &blksize : NULL,
+ aTotSize ? &totsize : NULL,
+ aFirst, aLast);
+ if (aBlkSize) {
+ *aBlkSize = blksize;
+ }
+ if (aTotSize) {
+ *aTotSize = totsize;
+ }
+
} catch (...) {
res = source->handleException();
}