svn commit: r298201 - head/lib/libc/stdlib
Sergey Kandaurov
pluknet at FreeBSD.org
Mon Apr 18 09:56:42 UTC 2016
Author: pluknet
Date: Mon Apr 18 09:56:41 2016
New Revision: 298201
URL: https://svnweb.freebsd.org/changeset/base/298201
Log:
Fixed indentation, minor style.
Modified:
head/lib/libc/stdlib/qsort.3
Modified: head/lib/libc/stdlib/qsort.3
==============================================================================
--- head/lib/libc/stdlib/qsort.3 Mon Apr 18 09:39:46 2016 (r298200)
+++ head/lib/libc/stdlib/qsort.3 Mon Apr 18 09:56:41 2016 (r298201)
@@ -252,16 +252,16 @@ and then prints the sorted array to stan
#include <stdlib.h>
/*
- * Custom comparison function that can compare 'int' values through pointers
+ * Custom comparison function that compares 'int' values through pointers
* passed by qsort(3).
*/
static int
int_compare(const void *p1, const void *p2)
{
- int left = *(const int *)p1;
- int right = *(const int *)p2;
+ int left = *(const int *)p1;
+ int right = *(const int *)p2;
- return ((left > right) - (left < right));
+ return ((left > right) - (left < right));
}
/*
@@ -270,15 +270,15 @@ int_compare(const void *p1, const void *
int
main(void)
{
- int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 };
- const size_t array_size = sizeof(int_array) / sizeof(int_array[0]);
- size_t k;
+ int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 };
+ size_t array_size = sizeof(int_array) / sizeof(int_array[0]);
+ size_t k;
- qsort(&int_array, array_size, sizeof(int_array[0]), int_compare);
- for (k = 0; k < array_size; k++)
- printf(" %d", int_array[k]);
- puts("");
- return (EXIT_SUCCESS);
+ qsort(&int_array, array_size, sizeof(int_array[0]), int_compare);
+ for (k = 0; k < array_size; k++)
+ printf(" %d", int_array[k]);
+ puts("");
+ return (EXIT_SUCCESS);
}
.Ed
.Sh COMPATIBILITY
More information about the svn-src-head
mailing list