def ctype(maxval):
    """Return the smallest unsigned C type with the given range."""
    if maxval < (1 << 8):
        return "unsigned char"
    if maxval < (1 << 16):
        return "unsigned short"
    return "unsigned"