llvm / Clang hacking: Part 1

Part 1 in my N-part series on my exploration of hacking on llvm and Clang (c-language) tool chain. I am running OS X 10.7, however I will try to highlight the steps where you should consider substituting for your platform. Getting Started Follow these steps, with the following exceptions if you prefer git (it is a lot faster); I am using the official llvm mirror on llvm.org. Step 2, substitute the svn command for ...

Jun 2, 2012 · 2 min

Objective-C: ternary operator

The ternary operator, also known as a conditional expression is a C construct. What follows is an example used for conditional assignment: result = condition_expression ? true_expression : false_expression; If condition_expression evaluates to true, result will be assigned the true_expression; otherwise, result will be assigned the false_expression. A GNU extension to the ternary operator, also available in Objective-C, is the ability to omit the true_expression as follows: result = first_expression ?: second_expression; result will be assigned the value of first_expression if it evaluates to true or second_expression if first_expression evaluates to false. ...

Mar 15, 2012 · 2 min

Associative References in Objective-C

This is some preamble. ...

Feb 19, 2012 · 2 min

Constant Confusion

The const keyword in C can be confusing, so I wanted to put down my thoughts for my own benefit and for those looking for some clarity. In summary, I’m going to advocate you place const to the right, and read the declaration from right to left. What is const? const is a hint to the C compiler and programmer that a specific declaration or element of a declaration is immutable. It is more complicated in C++, which is outside the scope of this post. Lets start with a simple example, and the most common form where const is written first: ...

Dec 3, 2011 · 5 min

Transferring Preview app signatures in Lion

Lion introduced a great new feature that allows you to capture your signature via an attached camera and store it in an encrypted form for later use. Therein lies the problem; you must have an attached camera. I have a Mac Pro, and wanted to use the signatures I captured on my Macbook Pro. Following these steps, you can transfer the encrypted signatures over. On your machine endowed with the power of sight: ...

Aug 3, 2011 · 2 min