| 189 | |
| 190 | |
| 191 | void ERR_post_warning(const Arg::StatusVector& v) |
| 192 | { |
| 193 | /************************************** |
| 194 | * |
| 195 | * E R R _ p o s t _ w a r n i n g |
| 196 | * |
| 197 | ************************************** |
| 198 | * |
| 199 | * Functional description |
| 200 | * Post a warning to the current status vector. |
| 201 | * |
| 202 | **************************************/ |
| 203 | fb_assert(v.value()[0] == isc_arg_warning); |
| 204 | |
| 205 | FbStatusVector* const statusVector = JRD_get_thread_data()->tdbb_status_vector; |
| 206 | const ISC_STATUS* toAdd = v.value(); |
| 207 | const unsigned lenToAdd = v.length(); |
| 208 | |
| 209 | if (!(statusVector->getState() & IStatus::STATE_WARNINGS)) |
| 210 | { |
| 211 | // this is a blank status vector just stuff the status |
| 212 | statusVector->setWarnings2(lenToAdd, toAdd); |
| 213 | return; |
| 214 | } |
| 215 | |
| 216 | const ISC_STATUS* oldVector = statusVector->getWarnings(); |
| 217 | unsigned lenOld = fb_utils::statusLength(oldVector); |
| 218 | |
| 219 | // check for duplicated error code |
| 220 | if (fb_utils::subStatus(oldVector, lenOld, toAdd, lenToAdd) != ~0u) |
| 221 | return; |
| 222 | |
| 223 | StaticStatusVector tmpWarn; |
| 224 | tmpWarn.assign(oldVector, lenOld); |
| 225 | tmpWarn.append(toAdd, lenToAdd); |
| 226 | statusVector->setWarnings2(tmpWarn.getCount(), tmpWarn.begin()); |
| 227 | } |
| 228 | |
| 229 | |
| 230 | void ERR_post_nothrow(const Arg::StatusVector& v, FbStatusVector* statusVector) |
no test coverage detected