Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: third_party/sqlite/src/ext/misc/percentile.c

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/ext/misc/memvfs.c ('k') | third_party/sqlite/src/ext/misc/regexp.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** 2013-05-28 2 ** 2013-05-28
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 p->nAlloc = n; 161 p->nAlloc = n;
162 p->a = a; 162 p->a = a;
163 } 163 }
164 p->a[p->nUsed++] = y; 164 p->a[p->nUsed++] = y;
165 } 165 }
166 166
167 /* 167 /*
168 ** Compare to doubles for sorting using qsort() 168 ** Compare to doubles for sorting using qsort()
169 */ 169 */
170 static int doubleCmp(const void *pA, const void *pB){ 170 static int SQLITE_CDECL doubleCmp(const void *pA, const void *pB){
171 double a = *(double*)pA; 171 double a = *(double*)pA;
172 double b = *(double*)pB; 172 double b = *(double*)pB;
173 if( a==b ) return 0; 173 if( a==b ) return 0;
174 if( a<b ) return -1; 174 if( a<b ) return -1;
175 return +1; 175 return +1;
176 } 176 }
177 177
178 /* 178 /*
179 ** Called to compute the final output of percentile() and to clean 179 ** Called to compute the final output of percentile() and to clean
180 ** up all allocated memory. 180 ** up all allocated memory.
(...skipping 29 matching lines...) Expand all
210 char **pzErrMsg, 210 char **pzErrMsg,
211 const sqlite3_api_routines *pApi 211 const sqlite3_api_routines *pApi
212 ){ 212 ){
213 int rc = SQLITE_OK; 213 int rc = SQLITE_OK;
214 SQLITE_EXTENSION_INIT2(pApi); 214 SQLITE_EXTENSION_INIT2(pApi);
215 (void)pzErrMsg; /* Unused parameter */ 215 (void)pzErrMsg; /* Unused parameter */
216 rc = sqlite3_create_function(db, "percentile", 2, SQLITE_UTF8, 0, 216 rc = sqlite3_create_function(db, "percentile", 2, SQLITE_UTF8, 0,
217 0, percentStep, percentFinal); 217 0, percentStep, percentFinal);
218 return rc; 218 return rc;
219 } 219 }
OLDNEW
« no previous file with comments | « third_party/sqlite/src/ext/misc/memvfs.c ('k') | third_party/sqlite/src/ext/misc/regexp.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698