pgiffuni commented on PR #178: URL: https://github.com/apache/openoffice/pull/178#issuecomment-6957874174
I passed it through my AI engine (NVidia Nemotron 3.5 free) and it was quite harsh: Problems in the proposed evaluator I would reject the evaluator as submitted. There are several independent problems. A. Apparent compilation errors The submitted code has multiple constructs that are not valid C++ as written: - switch(ReturnFormat.ToLowerAscii()) attempts to switch on a string. - The case labels (d, m, ym, md, yd, y) are not valid character or integral constant expressions. - Two diffMonth declarations occur in the same switch scope. - The Date(...) assignments in the md and yd cases lack terminating semicolons. - The sameYear expressions have unbalanced parentheses. These are not merely semantic concerns. The submitted implementation needs substantial rewriting before it can even be considered buildable. B. Start-date extraction is incorrect ... C. The month calculation is wrong The m case increments the result when EndDays > StartDays. For a normal forward interval, that is the situation in which the end date has not yet reached the corresponding day of the month, so the implementation should not be adding a completed month. The conditions also mix comparisons of serial dates with day-of-month comparisons, making the calculation unreliable around month boundaries. D. The year calculation contains an assignment/comparison error ... E. The md and yd calculations are not trustworthy Both cases construct intermediate dates and use fabs() to obtain a result. Apart from the syntax problems, this approach does not establish correct behavior for reverse date order, month ends, or year boundaries. Taking an absolute value also discards the direction of the difference without a normative basis for doing so. These defects are sufficient to rule out reusing the evaluator. The original author’s warning that the patch was unfinished was justified. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
