From 3e74d1c544648bf5ee9774a1c8afcd7b84b28bdd Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Wed, 25 Apr 2012 17:15:20 -1000 Subject: [PATCH] Fix documentation bug with typedef. --- docs/ispc.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/ispc.rst b/docs/ispc.rst index 9edd7325..a6cc24b7 100644 --- a/docs/ispc.rst +++ b/docs/ispc.rst @@ -1505,13 +1505,17 @@ Defining New Names For Types The ``typedef`` keyword can be used to name types: :: + + typedef int64 BigInt; + typedef float Float3[3]; - typedef Float3 float[3]; +Following C's syntax, the code above defines ``BigInt`` to have ``int64`` +type and ``Float3`` to have ``float[3]`` type. -``typedef`` doesn't create a new type: it just provides an alternative name -for an existing type. Thus, in the above example, it is legal to pass a -value with ``float[3]`` type to a function that has been declared to take a -``Float3`` parameter. +Also as in C, ``typedef`` doesn't create a new type: it just provides an +alternative name for an existing type. Thus, in the above example, it is +legal to pass a value with ``float[3]`` type to a function that has been +declared to take a ``Float3`` parameter. Pointer Types