Changeset 490
- Timestamp:
- 07/14/08 14:58:59 (4 months ago)
- Files:
-
- trunk/libsyncml/objects/sml_ds_server.c (modified) (12 diffs)
- trunk/libsyncml/sml_manager.c (modified) (7 diffs)
- trunk/libsyncml/sml_session.c (modified) (14 diffs)
- trunk/libsyncml/sml_transport.c (modified) (1 diff)
- trunk/libsyncml/syncml_internals.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libsyncml/objects/sml_ds_server.c
r477 r490 188 188 smlTrace(TRACE_ENTRY, "%s(%s, %p, %p)", __func__, type, location, error); 189 189 smlAssert(location); 190 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 191 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 190 192 191 193 SmlDsServer *server = smlTryMalloc0(sizeof(SmlDsServer), error); … … 212 214 smlAssert(location); 213 215 smlAssert(target); 216 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 217 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 214 218 215 219 SmlDsServer *server = smlTryMalloc0(sizeof(SmlDsServer), error); … … 311 315 smlAssert(server); 312 316 smlAssert(san); 317 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 318 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 313 319 314 320 if (!smlNotificationNewAlert(san, SML_ALERT_TWO_WAY_BY_SERVER, server->contenttype, smlLocationGetURI(server->location), error)) … … 353 359 smlAssert(server); 354 360 smlAssert(session); 361 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 362 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 355 363 356 364 SmlDsSession *dsession = smlDsSessionNew(server, session, error); … … 386 394 smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, server, session, error); 387 395 smlAssert(server); 396 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 397 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 388 398 389 399 SmlDsSession *dsession = smlTryMalloc0(sizeof(SmlDsSession), error); … … 926 936 smlTrace(TRACE_ENTRY, "%s(%p, %i, %s, %s, %p)", __func__, dsession, type, last, next, error); 927 937 smlAssert(dsession); 938 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 939 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 928 940 929 941 SmlCommand *alert = smlCommandNewAlert(type, dsession->target, dsession->location, next, last, NULL, error); … … 1019 1031 smlTrace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p)", __func__, dsession, num_changes, callback, userdata, error); 1020 1032 smlAssert(dsession); 1033 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1034 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1021 1035 1022 1036 if (dsession->syncCommand) { … … 1048 1062 smlTrace(TRACE_ENTRY, "%s(%p, %i, %s, %p, %i, %s, %p, %p, %p)", __func__, dsession, type, uid, data, size, contenttype, callback, userdata, error); 1049 1063 smlAssert(dsession); 1064 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1065 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1050 1066 1051 1067 if (!dsession->syncCommand) { … … 1098 1114 smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, dsession, error); 1099 1115 smlAssert(dsession); 1116 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1117 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1100 1118 1101 1119 if (!dsession->syncCommand) { … … 1122 1140 smlTrace(TRACE_ENTRY, "%s(%p, %s, %s, %p)", __func__, dsession, uid, newuid, error); 1123 1141 smlAssert(dsession); 1142 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1143 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1124 1144 1125 1145 SmlMapItem *item = smlMapItemNew(uid, newuid, error); … … 1150 1170 smlTrace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, dsession, callback, userdata, error); 1151 1171 smlAssert(dsession); 1172 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1173 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1152 1174 1153 1175 if (!dsession->mapItems) { … … 1273 1295 smlAssert(server); 1274 1296 smlAssert(manager); 1297 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1298 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1275 1299 1276 1300 if (!smlManagerObjectRegister(manager, SML_COMMAND_TYPE_ALERT, NULL, server->location, NULL, NULL, _recv_manager_alert, NULL, server, error)) trunk/libsyncml/sml_manager.c
r489 r490 325 325 smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, tsp, error); 326 326 smlAssert(tsp); 327 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 328 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 327 329 328 330 SmlManager *manager = smlTryMalloc0(sizeof(SmlManager), error); … … 430 432 smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, manager, error); 431 433 smlAssert(manager); 434 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 435 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 432 436 433 437 manager->functions->prepare = _manager_prepare_internal; … … 629 633 { 630 634 smlTrace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, manager, session, link, error); 635 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 636 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 631 637 632 638 smlSessionRef(session); … … 782 788 smlAssert(manager); 783 789 smlAssert(callback); 790 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 791 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 784 792 785 793 /* first we have to check if this an update for an already registered object */ … … 1019 1027 smlAssert(session); 1020 1028 smlAssert(header); 1029 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1030 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1021 1031 1022 1032 //If not send command to default handler … … 1051 1061 smlAssert(session); 1052 1062 smlAssert(parent); 1063 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1064 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1053 1065 1054 1066 //Check if a handler for this object at this path has been installed. … … 1093 1105 smlAssert(session); 1094 1106 smlAssert(cmd); 1107 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1108 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1095 1109 1096 1110 //Check if a handler for this object at this path has been installed. trunk/libsyncml/sml_session.c
r487 r490 94 94 smlAssert(session); 95 95 smlAssert(session->dataCallback); 96 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 97 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 96 98 97 99 char *data = NULL; … … 199 201 { 200 202 smlTrace(TRACE_ENTRY, "%s(%p, %p, %p, %i, %i, %i, %p)", __func__, session, orig_cmd, parent, space, start, complete_size, error); 203 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 204 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 201 205 /* This library must not send more that one item per change 202 206 * command. This is compliant with all specification and only a … … 299 303 smlAssert(session); 300 304 smlAssert(cmd); 305 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 306 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 301 307 SmlPendingStatus *pending = NULL; 302 308 SmlBool fragmented = FALSE; … … 497 503 smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, session, parent, error); 498 504 smlAssert(session); 505 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 506 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 499 507 500 508 if (!smlAssemblerEndCommand(session->assembler, parent, error)) … … 637 645 smlAssert(session); 638 646 smlAssert(header); 647 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 648 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 639 649 640 650 /* check and set the counters */ … … 707 717 smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, session, status, error); 708 718 smlAssert(status); 719 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 720 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 709 721 710 722 if (status->cmdRef == 0) { … … 936 948 smlAssert(session); 937 949 smlAssert(parser); 950 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 951 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 938 952 SmlStatus *status = NULL; 939 953 SmlCommand *cmd = NULL; … … 1700 1714 { 1701 1715 smlTrace(TRACE_ENTRY, "%s(%i, %i, %i, %i, %p, %p, %s, %i, %p)", __func__, sessionType, mimetype, version, protocol, target, source, sessionID, messageID, error); 1716 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1717 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1702 1718 1703 1719 /* Initialize GLib thread system. */ … … 1865 1881 smlTrace(TRACE_ENTRY, "%s(%p, %i, %p)", __func__, session, final, error); 1866 1882 smlAssert(session); 1867 smlAssert (error != NULL); /* common mistake */1868 smlAssert (*error == NULL); /* do not overwrite other error */1883 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1884 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1869 1885 1870 1886 SmlSessionCommand *sesscmd = smlTryMalloc0(sizeof(SmlSessionCommand), error); … … 1913 1929 smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, session, error); 1914 1930 smlAssert(session); 1915 smlAssert (error != NULL); /* common mistake */1916 smlAssert (*error == NULL); /* do not overwrite other error */1931 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 1932 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 1917 1933 1918 1934 if (! g_mutex_trylock(session->reportEnd)) … … 2251 2267 smlAssert(session); 2252 2268 smlAssert(cmd); 2269 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 2270 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 2253 2271 2254 2272 if (!smlSessionStartCommand(session, cmd, parent, callback, userdata, error)) … … 2282 2300 smlAssert(session); 2283 2301 smlAssert(cmd); 2302 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 2303 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 2284 2304 2285 2305 SmlSessionCommand *sesscmd = smlTryMalloc0(sizeof(SmlSessionCommand), error); … … 2321 2341 smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, session, parent, error); 2322 2342 smlAssert(session); 2343 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 2344 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 2323 2345 2324 2346 SmlSessionCommand *sesscmd = smlTryMalloc0(sizeof(SmlSessionCommand), error); … … 2362 2384 smlAssert(session); 2363 2385 smlAssert(status); 2386 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 2387 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 2364 2388 2365 2389 SmlSessionCommand *sesscmd = smlTryMalloc0(sizeof(SmlSessionCommand), error); trunk/libsyncml/sml_transport.c
r486 r490 718 718 smlAssert(tsp); 719 719 smlAssert(tsp->functions.finalize); 720 smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); 721 smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); 720 722 721 723 if (tsp->state != SML_TRANSPORT_INITIALIZED && trunk/libsyncml/syncml_internals.h
r295 r490 56 56 #include "sml_parse.h" 57 57 58 /* Error messages for assertions */ 59 #define SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL "The error handling of the function must be used." 60 #define SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY "The error parameter is already filled (ignored error)." 61 58 62 #endif
