<commit_before>/* assert.h
 *
 * <NAME>
 * 21 Nov 2013
 *
 * This header is a very simple assertion library used by terminator to run
 * system calls concisely.
 *
 * Define the ASSERT_DEBUG macro to enable debugging output.
 */

#ifndef MY_ASSERT_H_INCLUDED
#define MY_ASSERT_H_INCLUDED

/* Internal macro to implement debugging. Prints the name of the program, and
 * possibly the source file name and line number. */
#ifdef ASSERT_DEBUG
    #define ASSERT_PRINT_PROGRAM_NAME(FP) \
        fprintf((FP), "%s: %s: %d: ", ASSERT_PROGRAM_NAME, __FILE__, __LINE__)
#else
    #define ASSERT_PRINT_PROGRAM_NAME(FP) \
        fprintf((FP), "%s: ", ASSERT_PROGRAM_NAME)
#endif

/* Assert that X is nonzero. If the assertion fails, print an error message
 * suitable for the current errno to standard error and exit with failure. */
#define ASSERT(X) \
do { \
    if (!(X)) { \
        ASSERT_PRINT_PROGRAM_NAME(stderr); \
        perror(NULL); \
        exit(EXIT_FAILURE); \
    } \
} while (0)

/* Assert that X is nonzero. If the assertion fails, print MSG to standard
 * error and exit with failure. */
#define ASSERT_WITH_MESSAGE(X, MSG) \
do { \
    if (!(X)) { \
        ASSERT_PRINT_PROGRAM_NAME(stderr); \
        fprintf(stderr, "%s\n", MSG); \
        exit(EXIT_FAILURE); \
    } \
} while (0)

/* Assert that X is nonnegative. Behaves as ASSERT if the assertion fails. */
#define ASSERT_NONNEG(X) \
    ASSERT((X) >= 0)

/* Assert that X is nonnegative. Behaves as ASSERT_WITH_MESSAGE if the
 * assertion fails. */
#define ASSERT_NONNEG_WITH_MESSAGE(X, MSG) \
    ASSERT_WITH_MESSAGE((X) >= 0, MSG)

/* Assert that X is nonnegative. Behaves as ASSERT if the assertion fails. */
#define ASSERT_ZERO(X) \
    ASSERT((X) == 0)

/* Assert that X is nonnegative. Behaves as ASSERT_WITH_MESSAGE if the
 * assertion fails. */
#define ASSERT_ZERO_WITH_MESSAGE(X, MSG) \
    ASSERT_WITH_MESSAGE((X) == 0, MSG)

/* Assert that X is nonnegative. Behaves as ASSERT if the assertion fails. */
#define ASSERT_NONZERO(X) \
    ASSERT((X) != 0)

/* Assert that X is nonnegative. Behaves as ASSERT_WITH_MESSAGE if the
 * assertion fails. */
#define ASSERT_NONZERO_WITH_MESSAGE(X, MSG) \
    ASSERT_WITH_MESSAGE((X) != 0, MSG)

#endif /* MY_ASSERT_H_INCLUDED */
<commit_msg>Fix incorrect comment in my_assert.<commit_after>/* assert.h
 *
 * <NAME>
 * 21 Nov 2013
 *
 * This header is a very simple assertion library used by terminator to run
 * system calls concisely.
 *
 * Define the ASSERT_DEBUG macro to enable debugging output.
 */

#ifndef MY_ASSERT_H_INCLUDED
#define MY_ASSERT_H_INCLUDED

/* Internal macro to implement debugging. Prints the name of the program, and
 * possibly the source file name and line number. */
#ifdef ASSERT_DEBUG
    #define ASSERT_PRINT_PROGRAM_NAME(FP) \
        fprintf((FP), "%s: %s: %d: ", ASSERT_PROGRAM_NAME, __FILE__, __LINE__)
#else
    #define ASSERT_PRINT_PROGRAM_NAME(FP) \
        fprintf((FP), "%s: ", ASSERT_PROGRAM_NAME)
#endif

/* Assert that X is nonzero. If the assertion fails, print an error message
 * suitable for the current errno to standard error and exit with failure. */
#define ASSERT(X) \
do { \
    if (!(X)) { \
        ASSERT_PRINT_PROGRAM_NAME(stderr); \
        perror(NULL); \
        exit(EXIT_FAILURE); \
    } \
} while (0)

/* Assert that X is nonzero. If the assertion fails, print MSG to standard
 * error and exit with failure. */
#define ASSERT_WITH_MESSAGE(X, MSG) \
do { \
    if (!(X)) { \
        ASSERT_PRINT_PROGRAM_NAME(stderr); \
        fprintf(stderr, "%s\n", MSG); \
        exit(EXIT_FAILURE); \
    } \
} while (0)

/* Assert that X is nonnegative. Behaves as ASSERT if the assertion fails. */
#define ASSERT_NONNEG(X) \
    ASSERT((X) >= 0)

/* Assert that X is nonnegative. Behaves as ASSERT_WITH_MESSAGE if the
 * assertion fails. */
#define ASSERT_NONNEG_WITH_MESSAGE(X, MSG) \
    ASSERT_WITH_MESSAGE((X) >= 0, MSG)

/* Assert that X is nonnegative. Behaves as ASSERT if the assertion fails. */
#define ASSERT_ZERO(X) \
    ASSERT((X) == 0)

/* Assert that X is nonnegative. Behaves as ASSERT_WITH_MESSAGE if the
 * assertion fails. */
#define ASSERT_ZERO_WITH_MESSAGE(X, MSG) \
    ASSERT_WITH_MESSAGE((X) == 0, MSG)

/* Assert that X is nonzero. Behaves as ASSERT if the assertion fails. */
#define ASSERT_NONZERO(X) \
    ASSERT((X) != 0)

/* Assert that X is nonzero. Behaves as ASSERT_WITH_MESSAGE if the assertion
 * fails. */
#define ASSERT_NONZERO_WITH_MESSAGE(X, MSG) \
    ASSERT_WITH_MESSAGE((X) != 0, MSG)

#endif /* MY_ASSERT_H_INCLUDED */

{'fraction_non_alphanumeric': 0.11480828558836492, 'fraction_numerical': 0.00617011899515205, 'mean_word_length': 3.3477011494252875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5726300', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1466, 'n_words': 488}