27 Commits

Author SHA1 Message Date
Allan Odgaard
caaa36161d Change most fprintf log statements to using os_log 2020-05-04 19:20:04 +07:00
mathbunnyru
440414f96c Use nullptr in all C++ files instead of NULL
This brings us a bit of extra type safety, for example where an integer is expected, nullptr should be disallowed by the compiler (unlike NULL).
2016-10-22 21:40:14 +07:00
mathbunnyru
08ad760d5e static_cast instead of c-style cast 2016-10-18 23:06:48 +02:00
Allan Odgaard
c6efe7a06a Remove CGRectLessThan
This was never used for anything.
2016-07-10 11:29:41 +02:00
Allan Odgaard
29d2e52e13 Remove cf::image_t
This was previously used by layout_t but not since we introduced the CGContextRef wrapper (in b6ed16251e).
2016-07-10 11:29:41 +02:00
Allan Odgaard
d999aa7e39 Remove cf::timer_t
This was previously used by document_t to schedule backups.
2016-07-10 11:29:41 +02:00
Allan Odgaard
8483826fae Always use '\0' as fill value when creating a string buffer 2016-06-18 10:34:08 +02:00
Allan Odgaard
f06f447ede Avoid referencing private types by using std::remove_pointer 2015-08-27 22:46:53 +02:00
Allan Odgaard
39b94e6ac3 Harmonize whitespace and add trailing newline 2014-04-14 14:26:52 +07:00
Allan Odgaard
d549bb7a84 Remove unused include (cf/callback.h) 2014-04-12 11:22:38 +07:00
Allan Odgaard
c2397484b8 Use C++11 for loop
Majority of the edits done using the following ruby script:

    def update_loops(src)
      dst, cnt = '', 0

      block_indent, variable = nil, nil
      src.each_line do |line|
        if block_indent
          if line =~ /^#{block_indent}([{}\t])|^\t*$/
            block_indent = nil if $1 == '}'
            line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
              $1.to_s + variable + ($2 == "->" ? "." : "")
            end
          else
            block_indent = nil
          end
        elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
          block_indent, variable = $1, $2
          line = "#$1for(auto const& #$2 : #$3\n"
          cnt += 1
        end
        dst << line
      end
      return dst, cnt
    end

    paths.each do |path|
      src = IO.read(path)

      cnt = 1
      while cnt != 0
        src, cnt = update_loops(src)
        STDERR << "#{path}: #{cnt}\n"
      end

      File.open(path, "w") { |io| io << src }
    end
2014-03-03 10:34:13 +07:00
Allan Odgaard
e4e80a946c Use std::make_shared 2013-09-03 12:27:20 +02:00
Allan Odgaard
b747dc662b Delete cf::run_loop assignment/copy constructor
They were previously declared private, as they weren’t implemented and we can’t use generated versions.
2013-05-16 21:36:49 +07:00
Allan Odgaard
cd2b0882f0 Use new test system for a few frameworks 2013-02-22 15:55:28 +01:00
Allan Odgaard
a7c33be67e Remove cf::color_t
This wrapper is no longer used.
2013-02-20 12:54:52 +01:00
Allan Odgaard
4bae908d49 Move CGColorRef helper functions
These only have one user, so let’s make them private helper functions instead.
2013-02-20 12:54:26 +01:00
Allan Odgaard
75f3a0bfa2 Add cf::to_s for CGColorRef 2013-02-18 15:38:27 +01:00
Allan Odgaard
65c9594ff6 fixup! Let cf::to_s(NULL) return NULL_STR
Incase of an empty string CFStringGetBytes() returns 0 which we treated as an error. This caused empty strings to be turned into the NULL_STR placeholder.
2012-09-17 11:06:57 +02:00
Allan Odgaard
04272337ae Let cf::to_s(NULL) return NULL_STR
This was previously undefined. We also return NULL_STR when converting the CFString fails.
2012-09-12 18:30:37 +02:00
Allan Odgaard
b2acb02a7f Use std::function with cf::callback_t 2012-09-09 16:22:19 +02:00
Allan Odgaard
a3cedb5c58 Use std::function as callback type for setup_timer
There is a minor functional change in that the custom callback type uses event loop signaling that makes it safe to trigger the callback from a thread. This should however not be necessary for timers (which are all setup on the main thread).
2012-09-09 16:22:19 +02:00
Allan Odgaard
c154751045 Allow cf::color_t to be uninitialized 2012-09-08 01:00:41 +02:00
Allan Odgaard
cbe91ff831 Assume compiler support for explicit keyword
Since we require a fairly recent clang for other features, there is no reason to test for this one.
2012-08-29 14:27:35 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Jacob Bandes-Storch
66650f8190 Store component values in cf::color_t 2012-08-20 19:10:39 +02:00
jtbandes
4cc010c289 Helper function for getting CFError description 2012-08-11 23:04:00 -07:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00