| 2305 | |
| 2306 | |
| 2307 | VarSizeType Line::GetExpandedArgSize() |
| 2308 | // Returns the size, or VARSIZE_ERROR if there was a problem. |
| 2309 | // This function can return a size larger than what winds up actually being needed |
| 2310 | // (e.g. caused by ScriptGetCursor()), so our callers should be aware that that can happen. |
| 2311 | { |
| 2312 | int i; |
| 2313 | VarSizeType space_needed; |
| 2314 | |
| 2315 | // Note: the below loop is similar to the one in ExpandArgs(), so the two should be maintained together: |
| 2316 | for (i = 0, space_needed = 0; i < mArgc; ++i) // FOR EACH ARG: |
| 2317 | { |
| 2318 | ArgStruct &this_arg = mArg[i]; // For performance and convenience. |
| 2319 | |
| 2320 | if (this_arg.is_expression) |
| 2321 | { |
| 2322 | // The length used below is more room than is strictly necessary, but given how little |
| 2323 | // space is typically wasted (and that only while the expression is being evaluated), |
| 2324 | // it doesn't seem worth worrying about it. See other comments at macro definition. |
| 2325 | space_needed += EXPR_BUF_SIZE(this_arg.length); |
| 2326 | } |
| 2327 | // Since is_expression is false, it must be plain text or a non-dynamic input/output var. |
| 2328 | } |
| 2329 | |
| 2330 | return space_needed; |
| 2331 | } |
| 2332 | |
| 2333 |
nothing calls this directly
no outgoing calls
no test coverage detected