x1 = tri->coord[i1].x, y1 = tri->coord[i1].y;
x2 = tri->coord[i2].x, y2 = tri->coord[i2].y;
- // test for easy cases, else split trinagle in two and render both halfs
+ // test for easy cases, else split triangle in two and render both halfs
if (y1 == y2) {
if (x1 > x2) swap(&x1, &x2);
add_flat_triangle(image, x1, y1, x2, y2, x0, y0,
return true;
}
-static void psuedo_random_array(int arr[], unsigned int size)
+static void pseudo_random_array(int arr[], unsigned int size)
{
unsigned int i;
plan_tests(4);
- psuedo_random_array(tmparr, TEST_SIZE);
+ pseudo_random_array(tmparr, TEST_SIZE);
ok1(!is_sorted(tmparr, TEST_SIZE));
ok1(!is_reverse_sorted(tmparr, TEST_SIZE));
asort(tmparr, TEST_SIZE, test_cmp, &multiplier);
ok1(is_sorted(tmparr, TEST_SIZE));
- psuedo_random_array(tmparr, TEST_SIZE);
+ pseudo_random_array(tmparr, TEST_SIZE);
multiplier = -1;
asort(tmparr, TEST_SIZE, test_cmp, &multiplier);
ok1(is_reverse_sorted(tmparr, TEST_SIZE));
* @name: the name for this set of autodata
* @type: the type this autodata points to
*
- * This macro is usually placed in a header: it must preceed any
+ * This macro is usually placed in a header: it must precede any
* autodata functions in the file.
*
* Example:
/**
* bitops_ffs32: find first set bit in a uint32_t
*
- * Returns 1 for least signficant bit, 32 for most significant bit, 0
+ * Returns 1 for least significant bit, 32 for most significant bit, 0
* for no bits set.
*/
static inline int bitops_ffs32(uint32_t u)
/**
* bitops_ffs64: find lowest set bit in a uint64_t
*
- * Returns 1 for least signficant bit, 32 for most significant bit, 0
+ * Returns 1 for least significant bit, 32 for most significant bit, 0
* for no bits set.
*/
static inline int bitops_ffs64(uint64_t u)
/**
* bitops_clz32: count leading zeros in a uint32_t (must not be 0)
*
- * Returns 0 if most signficant bit is set, 31 if only least
- * signficant bit is set.
+ * Returns 0 if most significant bit is set, 31 if only least
+ * significant bit is set.
*/
static inline int bitops_clz32(uint32_t u)
{
/**
* bitops_clz64: count leading zeros in a uint64_t (must not be 0)
*
- * Returns 0 if most signficant bit is set, 63 if only least
- * signficant bit is set.
+ * Returns 0 if most significant bit is set, 63 if only least
+ * significant bit is set.
*/
static inline int bitops_clz64(uint64_t u)
{
/**
* bitops_ctz32: count trailing zeros in a uint32_t (must not be 0)
*
- * Returns 0 if least signficant bit is set, 31 if only most
- * signficant bit is set.
+ * Returns 0 if least significant bit is set, 31 if only most
+ * significant bit is set.
*/
static inline int bitops_ctz32(uint32_t u)
{
/**
* bitops_ctz64: count trailing zeros in a uint64_t (must not be 0)
*
- * Returns 0 if least signficant bit is set, 63 if only most
- * signficant bit is set.
+ * Returns 0 if least significant bit is set, 63 if only most
+ * significant bit is set.
*/
static inline int bitops_ctz64(uint64_t u)
{
/**
* bitops_ls32: find lowest set bit in a uint32_t (must not be zero)
*
- * Returns 0 for least signficant bit, 31 for most significant bit.
+ * Returns 0 for least significant bit, 31 for most significant bit.
*/
static inline int bitops_ls32(uint32_t u)
{
/**
* bitops_ls64: find lowest set bit in a uint64_t (must not be zero)
*
- * Returns 0 for least signficant bit, 63 for most significant bit.
+ * Returns 0 for least significant bit, 63 for most significant bit.
*/
static inline int bitops_ls64(uint64_t u)
{
/**
* bitops_hs32: find highest set bit in a uint32_t (must not be zero)
*
- * Returns 0 for least signficant bit, 31 for most significant bit.
+ * Returns 0 for least significant bit, 31 for most significant bit.
*/
static inline int bitops_hs32(uint32_t u)
{
/**
* bitops_hs64: find highest set bit in a uint64_t (must not be zero)
*
- * Returns 0 for least signficant bit, 63 for most significant bit.
+ * Returns 0 for least significant bit, 63 for most significant bit.
*/
static inline int bitops_hs64(uint64_t u)
{
/**
* bitops_lc32: find lowest clear bit in a uint32_t (must not be 0xFFFFFFFF)
*
- * Returns 0 for least signficant bit, 31 for most significant bit.
+ * Returns 0 for least significant bit, 31 for most significant bit.
*/
static inline int bitops_lc32(uint32_t u)
{
/**
* bitops_lc64: find lowest clear bit in a uint64_t (must not be 0xFFFFFFFFFFFFFFFF)
*
- * Returns 0 for least signficant bit, 63 for most significant bit.
+ * Returns 0 for least significant bit, 63 for most significant bit.
*/
static inline int bitops_lc64(uint64_t u)
{
/**
* bitops_hc32: find highest clear bit in a uint32_t (must not be 0xFFFFFFFF)
*
- * Returns 0 for least signficant bit, 31 for most significant bit.
+ * Returns 0 for least significant bit, 31 for most significant bit.
*/
static inline int bitops_hc32(uint32_t u)
{
/**
* bitops_hc64: find highest clear bit in a uint64_t (must not be 0xFFFFFFFFFFFFFFFF)
*
- * Returns 0 for least signficant bit, 63 for most significant bit.
+ * Returns 0 for least significant bit, 63 for most significant bit.
*/
static inline int bitops_hc64(uint64_t u)
{
* Stack management
*/
-/* Returns lowest stack addres, regardless of growth direction */
+/* Returns lowest stack address, regardless of growth direction */
static UNNEEDED void *coroutine_stack_base(struct coroutine_stack *stack)
{
#if HAVE_STACK_GROWS_UPWARDS
block.h.u.u8[3], block.h.u.u8[4], block.h.u.u8[5],
(unsigned long long)time_to_nsec(diff));
- /* Now, don't re-initalize every time; use Transform */
+ /* Now, don't re-initialize every time; use Transform */
memset(&block, 0, sizeof(block));
sha256(&block.h, &n, sizeof(n));
block.u8[sizeof(block.h)] = 0x80;
* rest of the string. Every machine with memory protection I've seen
* does it on word boundaries, so is OK with this. But VALGRIND will
* still catch it and complain. The masking trick does make the hash
- * noticably faster for short strings (like English words).
+ * noticeably faster for short strings (like English words).
*
* Not on my testing with gcc 4.5 on an intel i5 CPU, at least --RR.
*/
* rest of the string. Every machine with memory protection I've seen
* does it on word boundaries, so is OK with this. But VALGRIND will
* still catch it and complain. The masking trick does make the hash
- * noticably faster for short strings (like English words).
+ * noticeably faster for short strings (like English words).
*
* Not on my testing with gcc 4.5 on an intel i5 CPU, at least --RR.
*/
/**
* uintmap_after - get the closest following index in an unsigned intmap
* @umap: the typed intmap to iterate through.
- * @indexp: the preceeding index (may not exist)
+ * @indexp: the preceding index (may not exist)
*
* Returns NULL if the there is no entry > @indexp, otherwise
* populates *@indexp and returns the lowest entry > @indexp.
/**
* sintmap_after - get the closest following index in a signed intmap
* @smap: the typed intmap to iterate through.
- * @indexp: the preceeding index (may not exist)
+ * @indexp: the preceding index (may not exist)
*
* Returns NULL if the there is no entry > @indexp, otherwise
* populates *@indexp and returns the lowest entry > @indexp.
}
/*
- * parse the data in blob and calcualte the size of a full report luns datain structure
+ * parse the data in blob and calculate the size of a full report luns datain structure
*/
static int scsi_reportluns_datain_getfullsize(struct scsi_task *task)
{
}
/*
- * parse the data in blob and calcualte the size of a full readcapacity10 datain structure
+ * parse the data in blob and calculate the size of a full readcapacity10 datain structure
*/
static int scsi_readcapacity10_datain_getfullsize(struct scsi_task *task
UNUSED)
}
/*
- * parse the data in blob and calcualte the size of a full inquiry datain structure
+ * parse the data in blob and calculate the size of a full inquiry datain structure
*/
static int scsi_inquiry_datain_getfullsize(struct scsi_task *task)
{
}
/*
- * parse the data in blob and calcualte the size of a full report luns datain structure
+ * parse the data in blob and calculate the size of a full report luns datain structure
*/
static int scsi_modesense6_datain_getfullsize(struct scsi_task *task)
{
/**
* list_for_each_off - iterate through a list of memory regions.
* @h: the list_head
- * @i: the pointer to a memory region wich contains list node data.
+ * @i: the pointer to a memory region which contains list node data.
* @off: offset(relative to @i) at which list node data resides.
*
* This is a low-level wrapper to iterate @i over the entire list, used to
/**
* list_for_each_rev_off - iterate through a list of memory regions backwards
* @h: the list_head
- * @i: the pointer to a memory region wich contains list node data.
+ * @i: the pointer to a memory region which contains list node data.
* @off: offset(relative to @i) at which list node data resides.
*
* See list_for_each_off for details
* list_for_each_safe_off - iterate through a list of memory regions, maybe
* during deletion
* @h: the list_head
- * @i: the pointer to a memory region wich contains list node data.
+ * @i: the pointer to a memory region which contains list node data.
* @nxt: the structure containing the list_node
* @off: offset(relative to @i) at which list node data resides.
*
* list_for_each_rev_safe_off - iterate backwards through a list of
* memory regions, maybe during deletion
* @h: the list_head
- * @i: the pointer to a memory region wich contains list node data.
+ * @i: the pointer to a memory region which contains list node data.
* @nxt: the structure containing the list_node
* @off: offset(relative to @i) at which list node data resides.
*
predecessor instead.
The predecessor is guaranteed to have at most one child
node since its right arm must be NULL
- (It must be NULL since we are its sucessor and we are above
+ (It must be NULL since we are its successor and we are above
it in the tree)
*/
if (node->left != NULL && node->right != NULL) {
* rfc822_free - free an rfc822 message
* @msg: message to free
*
- * Frees an rfc822_msg context, including all subsiduary data
+ * Frees an rfc822_msg context, including all subsidiary data
* structures.
*/
void rfc822_free(struct rfc822_msg *msg);
/**
* str/hex - hex-to-string conversions and vice-versa
*
- * This code contains simple routines for hexidecimal strings.
+ * This code contains simple routines for hexadecimal strings.
*
* License: CC0 (Public domain)
* Author: Rusty Russell <rusty@rustcorp.com.au>
/**
* hex_decode - Unpack a hex string.
- * @str: the hexidecimal string
+ * @str: the hexadecimal string
* @slen: the length of @str
* @buf: the buffer to write the data into
* @bufsize: the length of @buf
* threshold. Two measurements are used as rejecting filters (i.e. a failure to
* exceed the threshold prevents further measurements being made):
*
- * 4a. Comparsion of string lengths: String lengths must be within given bounds
+ * 4a. Comparison of string lengths: String lengths must be within given bounds
* to satisfy the user-supplied similarity constraint. A negative result avoids
* invoking the O(m * n) behaviour of LCS at the cost of O(m + n) in the two
* strlen() invocations.
#include <string.h>
/**
- * tal/stack - stack of tal contextes (inspired by talloc_stack)
+ * tal/stack - stack of tal contexts (inspired by talloc_stack)
*
* Implement a stack of tal contexts. A new (empty) context is pushed on top
* of the stack using tal_newframe and it is popped/freed using tal_free().
*
* Allocates and push a new tal context on top of the stack.
* The context must be freed using tal_free() which will also pop it
- * off the stack, which will also free all its nested contextes, if any.
+ * off the stack, which will also free all its nested contexts, if any.
*
* NOTE: this function is not threadsafe.
*
old_parent = ignore_destroying_bit(t->parent_child)->parent;
if (unlikely(!add_child(newpar, t))) {
- /* We can always add to old parent, becuase it has a
+ /* We can always add to old parent, because it has a
* children property already. */
if (!add_child(old_parent, t))
abort();
/*
remove a specific parent context from a pointer. This is a more
- controlled varient of talloc_free()
+ controlled variant of talloc_free()
*/
int talloc_unlink(const void *context, void *ptr)
{
.Xc
.El
.Pp
-For maximum compatability your test program should return a particular
+For maximum compatibility your test program should return a particular
exit code. This is calculated by
.Fn exit_status
so it is sufficient to always return from
functionality, written using
.Nm .
Examine them for examples of how to construct test suites.
-.Sh COMPATABILITY
+.Sh COMPATIBILITY
.Nm
strives to be compatible with the Perl Test::More and Test::Harness
modules. The test suite verifies that
};
/**
- * struct timeabs - an absolue time.
+ * struct timeabs - an absolute time.
* @ts: the actual timespec value.
*
* For example, Midnight UTC January 1st, 1970: ts.tv_sec = 0, ts.tv_nsec = 0
* tlist - typesafe double linked list routines
*
* The list header contains routines for manipulating double linked lists;
- * this extends it so you can create list head types which only accomodate
+ * this extends it so you can create list head types which only accommodate
* a specific entry type.
*
* Example:
}
/**
- * TLIST_INIT - initalizer for an empty tlist
+ * TLIST_INIT - initializer for an empty tlist
* @name: the name of the list.
*
* Explicit initializer for an empty list.
* tlist2 - typesafe double linked list routines, alternative form
*
* The list header contains routines for manipulating double linked lists;
- * this extends it so you can create list head types which only accomodate
+ * this extends it so you can create list head types which only accommodate
* a specific entry type.
*
* Compared to 'tlist', this:
TCON_CONTAINER(canary, etype, link))
/**
- * TLIST2_INIT - initalizer for an empty tlist
+ * TLIST2_INIT - initializer for an empty tlist
* @name: the name of the list.
*
* Explicit initializer for an empty list.
* @x: pointer to xstring
* @src: string to append
*
- * Run xstrAdd. Reterminate at inital length if truncation occurs.
+ * Run xstrAdd. Reterminate at initial length if truncation occurs.
*
* Return: x->truncated
*/
* @x: pointer to xstring
* @...: one or more strings followed by NULL
*
- * Run xstrCat. Reterminate at inital length if truncation occurs.
+ * Run xstrCat. Reterminate at initial length if truncation occurs.
*
* Return: x->truncated
*/
* @sep: separator string
* @...: one or more strings followed by NULL
*
- * Run xstrJoin. Reterminate at inital length if truncation occurs.
+ * Run xstrJoin. Reterminate at initial length if truncation occurs.
*
* Return: x->truncated
*/
* @x: pointer to xstring
* @...: one or more pairs of string and length followed by NULL
*
- * Run xstrAddSubs. Reterminate at inital length if truncation occurs.
+ * Run xstrAddSubs. Reterminate at initial length if truncation occurs.
*
* Return: x->truncated
*/
},
};
-/* License compatibilty chart (simplified: we don't test that licenses between
+/* License compatibility chart (simplified: we don't test that licenses between
* files are compatible). */
#define O true
#define X false
#undef O
/* See GPLv2 and v2 (basically same wording) for interpreting versions:
- * the "any later version" means the recepient can choose. */
+ * the "any later version" means the recipient can choose. */
enum license which_license(struct doc_section *d)
{
if (!d)