Fossil SCM

Added blob_swap() to simplify some json code.

stephan 2012-07-13 16:56 trunk
Commit 2e2cd82bacc7a952416dc114b1c20a2f19e9ca93
1 file changed +11
+11
--- src/blob.c
+++ src/blob.c
@@ -1081,5 +1081,16 @@
10811081
memcpy( pDest, pIn->aData, nLen );
10821082
pIn->iCursor += nLen;
10831083
}
10841084
return nLen;
10851085
}
1086
+
1087
+/*
1088
+** Swaps the contents of the given blobs. Results
1089
+** are unspecified if either value is NULL or both
1090
+** point to the same blob.
1091
+*/
1092
+void blob_swap( Blob *pLeft, Blob *pRight ){
1093
+ Blob swap = *pLeft;
1094
+ *pLeft = *pRight;
1095
+ *pRight = swap;
1096
+}
10861097
--- src/blob.c
+++ src/blob.c
@@ -1081,5 +1081,16 @@
1081 memcpy( pDest, pIn->aData, nLen );
1082 pIn->iCursor += nLen;
1083 }
1084 return nLen;
1085 }
 
 
 
 
 
 
 
 
 
 
 
1086
--- src/blob.c
+++ src/blob.c
@@ -1081,5 +1081,16 @@
1081 memcpy( pDest, pIn->aData, nLen );
1082 pIn->iCursor += nLen;
1083 }
1084 return nLen;
1085 }
1086
1087 /*
1088 ** Swaps the contents of the given blobs. Results
1089 ** are unspecified if either value is NULL or both
1090 ** point to the same blob.
1091 */
1092 void blob_swap( Blob *pLeft, Blob *pRight ){
1093 Blob swap = *pLeft;
1094 *pLeft = *pRight;
1095 *pRight = swap;
1096 }
1097

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button