<commit_before>// Copyright (c) 2010 <NAME> and others. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_COMMON_H_
#define BASE_COMMON_H_

#include <stdio.h>
#include <stdlib.h>

// Use CHECK instead of abort.
// TODO(timurrrr): print stack trace when hitting a CHECK while preserving
// "abort trap" feature on both Windows and POSIX.
#define CHECK(x) \
    do {\
      if ((x) == 0) { \
        fprintf(stderr, "CHECK failed: " #x " at " __FILE__ ":%d\n", __LINE__); \
        abort(); \
      } \
    } while (0)

#ifdef _DEBUG
#define DCHECK(x) CHECK(x)
#else
#define NDEBUG
#define DCHECK(x) do { } while (0 && (x))
#endif

// Use this macro to disable copy constructor and operator= for CLASS_NAME. See
// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Copy_Constructors#Copy_Constructors
#define DISALLOW_COPY_AND_ASSIGN(CLASS_NAME) \
      CLASS_NAME(const CLASS_NAME &); \
  void operator=(const CLASS_NAME &);

#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

typedef unsigned char  uchar;
typedef unsigned char  byte;
typedef unsigned short ushort;
typedef unsigned int   uint;
const uint MAX_UINT = 0xFFFFFFFF;
// TODO(timurrrr): add 64-bit and ptr type values when necessary.
<commit_msg>Better comment and error message format for CHECK<commit_after>// Copyright (c) 2010 <NAME> and others. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_COMMON_H_
#define BASE_COMMON_H_

#include <stdio.h>
#include <stdlib.h>

// Use CHECK instead of assert for the following reasons:
// a) CHECKs remain when NDEBUG is defined (use DCHECK for debug-only checks)
// b) Has the same error message format on all platforms
// c) TODO(timurrrr): print stack trace when hitting a CHECK while preserving
//    "abort trap" feature on both Windows and POSIX.
// TODO(timurrrr): use OutputDebugString on Windows.
#define CHECK(x) \
    do {\
      if ((x) == 0) { \
        fprintf(stderr, "CHECK failed: \"%s\" at %s:%d\n", \
                #x, __FILE__, __LINE__); \
        abort(); \
      } \
    } while (0)

#ifdef _DEBUG
#define DCHECK(x) CHECK(x)
#else
#define NDEBUG
#define DCHECK(x) do { } while (0 && (x))
#endif

// Use this macro to disable copy constructor and operator= for CLASS_NAME. See
// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Copy_Constructors#Copy_Constructors
#define DISALLOW_COPY_AND_ASSIGN(CLASS_NAME) \
      CLASS_NAME(const CLASS_NAME &); \
  void operator=(const CLASS_NAME &);

#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

typedef unsigned char  uchar;
typedef unsigned char  byte;
typedef unsigned short ushort;
typedef unsigned int   uint;
const uint MAX_UINT = 0xFFFFFFFF;
// TODO(timurrrr): add 64-bit and ptr type values when necessary.

{'fraction_non_alphanumeric': 0.11537144813420061, 'fraction_numerical': 0.007531667237247518, 'mean_word_length': 3.6752, 'pattern_counts': {'":': 1, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 2, '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': '598421', 'n_tokens_mistral': 985, 'n_tokens_neox': 941, 'n_words': 330}