[Asterisk-code-review] res_calendar: output busy state as part of show calendar. (asterisk[master])

Sean Bright asteriskteam at digium.com
Thu Mar 23 08:56:57 CDT 2023


Attention is currently required from: Jaco Kroon.

Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/20024 )

Change subject: res_calendar: output busy state as part of show calendar.
......................................................................


Patch Set 2: Code-Review-1

(4 comments)

File include/asterisk/calendar.h:

https://gerrit.asterisk.org/c/asterisk/+/20024/comment/bc04c6d8_74cd83a4 
PS2, Line 207: const char* ast_calendar_busy_state_to_str(enum ast_calendar_busy_state busy_state);
There should be a space before the `*` and not after.

Additionally you should document the parameter and the return value.


File res/res_calendar.c:

https://gerrit.asterisk.org/c/asterisk/+/20024/comment/0cc836cc_d5f96706 
PS2, Line 360: const char* ast_calendar_busy_state_to_str(enum ast_calendar_busy_state busy_state)
There should be a space before the `*` and not after.


https://gerrit.asterisk.org/c/asterisk/+/20024/comment/6906e231_4ddcabf0 
PS2, Line 369: default:
             : 		return NULL;
If `busy_state` can be something other than the 3 defined values I would argue that is a bug that should be fixed rather than papered over. Assuming it cannot be something unexpected than I feel an `ast_assert(0)` would be more appropriate than returning `NULL`.


https://gerrit.asterisk.org/c/asterisk/+/20024/comment/e9550103_a322f41f 
PS2, Line 1700: 		ast_cli(a->fd, FORMAT2, "Busy State", ast_calendar_busy_state_to_str(event->busy_state) ?: "Unknown (Busy)");
If the above change is made then the ternary is not needed.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/20024
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I894e4ecc3e93db4ff7783d46266ba3c5e6ccda10
Gerrit-Change-Number: 20024
Gerrit-PatchSet: 2
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Jaco Kroon <jaco at uls.co.za>
Gerrit-Comment-Date: Thu, 23 Mar 2023 13:56:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230323/333636c9/attachment.html>


More information about the asterisk-code-review mailing list