hw8: autoformat
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
#include "buf.h"
|
#include "buf.h"
|
||||||
|
|
||||||
void *
|
void* buf_grow1(void* v, size_t esize, ptrdiff_t n) {
|
||||||
buf_grow1(void *v, size_t esize, ptrdiff_t n)
|
|
||||||
{
|
|
||||||
struct buf* p;
|
struct buf* p;
|
||||||
size_t max = (size_t)-1 - sizeof(struct buf);
|
size_t max = (size_t)-1 - sizeof(struct buf);
|
||||||
if (v) {
|
if (v) {
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "minctest.h"
|
#include "minctest.h"
|
||||||
|
|
||||||
#include "buf.h"
|
#include "buf.h"
|
||||||
|
|
||||||
|
|
||||||
void test_buf_squares_operator() {
|
void test_buf_squares_operator() {
|
||||||
long* ai = 0;
|
long* ai = 0;
|
||||||
for (int i = 0; i < 10000; i++)
|
for (int i = 0; i < 10000; i++)
|
||||||
@@ -61,8 +60,7 @@ void test_buf_base() {
|
|||||||
buf_free(a);
|
buf_free(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char* argv[]) {
|
||||||
{
|
|
||||||
lrun("buf_push(), []", test_buf_squares_operator);
|
lrun("buf_push(), []", test_buf_squares_operator);
|
||||||
lrun("buf_grow(), buf_trunc", test_buf_grow_trunc);
|
lrun("buf_grow(), buf_trunc", test_buf_grow_trunc);
|
||||||
lrun("buf_base_test", test_buf_base);
|
lrun("buf_base_test", test_buf_base);
|
||||||
|
|||||||
Reference in New Issue
Block a user