Fossil

Check-in [74132292]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added a pedantic catch for a corner case which never happens (for porting's sake).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7413229200e8c816e0f31b8024944b1381909e1c
User & Date: stephan 2014-03-17 21:05:08
Context
2014-03-18
14:52
remove unused variable check-in: dfca1237 user: jan.nijtmans tags: trunk
08:39
merge trunk Closed-Leaf check-in: 5efa7d2e user: jan.nijtmans tags: strip-trailing-cr
2014-03-17
21:05
Added a pedantic catch for a corner case which never happens (for porting's sake). check-in: 74132292 user: stephan tags: trunk
14:15
skip some tests when running inside of an open checkout. check-in: 36a8d91d user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/diff.c.

2140
2141
2142
2143
2144
2145
2146

2147
2148
2149
2150
2151
2152
2153
/*
** Return a color from a gradient.
*/
unsigned gradient_color(unsigned c1, unsigned c2, int n, int i){
  unsigned c;   /* Result color */
  unsigned x1, x2;
  if( i==0 || n==0 ) return c1;

  x1 = (c1>>16)&0xff;
  x2 = (c2>>16)&0xff;
  c = (x1*(n-i) + x2*i)/n<<16 & 0xff0000;
  x1 = (c1>>8)&0xff;
  x2 = (c2>>8)&0xff;
  c |= (x1*(n-i) + x2*i)/n<<8 & 0xff00;
  x1 = c1&0xff;







>







2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
/*
** Return a color from a gradient.
*/
unsigned gradient_color(unsigned c1, unsigned c2, int n, int i){
  unsigned c;   /* Result color */
  unsigned x1, x2;
  if( i==0 || n==0 ) return c1;
  else if(i>=n) return c2;
  x1 = (c1>>16)&0xff;
  x2 = (c2>>16)&0xff;
  c = (x1*(n-i) + x2*i)/n<<16 & 0xff0000;
  x1 = (c1>>8)&0xff;
  x2 = (c2>>8)&0xff;
  c |= (x1*(n-i) + x2*i)/n<<8 & 0xff00;
  x1 = c1&0xff;