<commit_before>

/* ring_test.cpp 
a test consol to see if ringbuffer's exceptions are working fine 
with exceeding push and pop options
*/



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


#include "ring.h"

using namespace std;




void main()
{
	const int buffer_size = 5;
	const int push_size = 7;
	int pop_size = 12;


	ptr_t data[buffer_size];
	ptr_t pop_data;

	struct ring* ring_buffer = ring_create( buffer_size );




	for( int i = 0; i < push_size  ; i++)
	{

		data[i] = new int[1];
		//data[i] = new char[1];

		int err = ring_push(ring_buffer, &data[i]);

		
		if ( err == 0 )
		{
			printf("push data %d = %d \n", i, &data[i]);
		}
		else
		{
			printf("push %d failed \n ", i);
		}
	}


	for( int i = 0; i < pop_size  ; i++)
	{
		pop_data = ring_pop(ring_buffer);

		if(pop_data == NULL)
		{
			printf("pop %d failed \n" , i);
		}
		else
		{
			printf("pop data %d = %d\n", i, pop_data);
		}
	}
	

//	enter any word and hit enter to close the promp
	std::cout << "enter any word and hit enter to close the promp" << std::endl ;
	int end;
	std::cin >> end ; 


}<commit_msg>Style Updated<commit_after>

/* ring_test.cpp 
a test consol to see if ringbuffer's exceptions are working fine 
with exceeding push and pop options
*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>


#include "ring.h"

using namespace std;


void main()
{
	const int buffer_size = 5;
	const int push_size = 7;
	int pop_size = 12;


	void* data[buffer_size];
	void* pop_data;

	struct ring* ring_buffer = ring_create( buffer_size );



	for( int i = 0; i < push_size  ; i++)
	{

		data[i] = new int[1];
		//data[i] = new char[1];

		int err = ring_push(ring_buffer, &data[i]);


		if ( err == 0 ){
			printf("push data %d = %d \n", i, &data[i]);
		}
		else{
			printf("push %d failed \n ", i);
		}
	}


	for( int i = 0; i < pop_size  ; i++)
	{
		pop_data = ring_pop(ring_buffer);

		if(pop_data == NULL){
			printf("pop %d failed \n" , i);
		}
		else{
			printf("pop data %d = %d\n", i, pop_data);
		}
	}


	//	enter any word and hit enter to close the promp
	std::cout << "enter any word and hit enter to close the promp" << std::endl ;
	int end;
	std::cin >> end ; 


}
{'fraction_non_alphanumeric': 0.15279048490393413, 'fraction_numerical': 0.008234217749313814, 'mean_word_length': 2.9193548387096775, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 13, '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': '6580047', 'n_tokens_mistral': 960, 'n_tokens_neox': 849, 'n_words': 269}