| 1373 | } |
| 1374 | |
| 1375 | unsigned int mergeStatus(ISC_STATUS* const dest, unsigned int space, |
| 1376 | const Firebird::IStatus* from) throw() |
| 1377 | { |
| 1378 | const ISC_STATUS* s; |
| 1379 | unsigned int copied = 0; |
| 1380 | const int state = from->getState(); |
| 1381 | ISC_STATUS* to = dest; |
| 1382 | |
| 1383 | if (state & Firebird::IStatus::STATE_ERRORS) |
| 1384 | { |
| 1385 | s = from->getErrors(); |
| 1386 | copied = copyStatus(to, space, s, statusLength(s)); |
| 1387 | |
| 1388 | to += copied; |
| 1389 | space -= copied; |
| 1390 | } |
| 1391 | |
| 1392 | if (state & Firebird::IStatus::STATE_WARNINGS) |
| 1393 | { |
| 1394 | if (!copied) |
| 1395 | { |
| 1396 | init_status(to); |
| 1397 | to += 2; |
| 1398 | space -= 2; |
| 1399 | copied += 2; |
| 1400 | } |
| 1401 | s = from->getWarnings(); |
| 1402 | copied += copyStatus(to, space, s, statusLength(s)); |
| 1403 | } |
| 1404 | |
| 1405 | if (!copied) |
| 1406 | init_status(dest); |
| 1407 | |
| 1408 | return copied; |
| 1409 | } |
| 1410 | |
| 1411 | void copyStatus(Firebird::CheckStatusWrapper* to, const Firebird::IStatus* from) throw() |
| 1412 | { |
no test coverage detected