Changeset 9b20126 in mainline for uspace/lib/pcut/src/report/report.c


Ignore:
Timestamp:
2014-09-19T08:23:01Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c85a57f
Parents:
15d0046
Message:

Update PCUT to newest version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/report/report.c

    r15d0046 r9b20126  
    4444 *
    4545 * @param op Operation to be called on the pcut_report_ops_t.
     46 * @param ... Arguments to the operation.
    4647 */
    4748#define REPORT_CALL(op, ...) \
    4849        if ((report_ops != NULL) && (report_ops->op != NULL)) report_ops->op(__VA_ARGS__)
     50
     51/** Call a report function if it is available.
     52 *
     53 * @param op Operation to be called on the pcut_report_ops_t.
     54 */
     55#define REPORT_CALL_NO_ARGS(op) \
     56                if ((report_ops != NULL) && (report_ops->op != NULL)) report_ops->op()
    4957
    5058/** Print error message.
     
    94102        /* Ensure that we do not read past the full_output. */
    95103        if (full_output[full_output_size - 1] != 0) {
    96                 // FIXME: can this happen?
     104                /* FIXME: can this happen? */
    97105                return;
    98106        }
    99107
    100108        while (1) {
     109                size_t message_length;
     110
    101111                /* First of all, count number of zero bytes before the text. */
    102112                size_t cont_zeros_count = 0;
     
    111121
    112122                /* Determine the length of the text after the zeros. */
    113                 size_t message_length = pcut_str_size(full_output);
     123                message_length = pcut_str_size(full_output);
    114124
    115125                if (cont_zeros_count < 2) {
    116126                        /* Okay, standard I/O. */
    117127                        if (message_length > stdio_buffer_size) {
    118                                 // TODO: handle gracefully
     128                                /* TODO: handle gracefully */
    119129                                return;
    120130                        }
     
    125135                        /* Error message. */
    126136                        if (message_length > error_buffer_size) {
    127                                 // TODO: handle gracefully
     137                                /* TODO: handle gracefully */
    128138                                return;
    129139                        }
     
    213223 *
    214224 */
    215 void pcut_report_done() {
    216         REPORT_CALL(done);
    217 }
    218 
     225void pcut_report_done(void) {
     226        REPORT_CALL_NO_ARGS(done);
     227}
     228
Note: See TracChangeset for help on using the changeset viewer.