All pastes #2060331 Raw Edit

Anonymous

public text v1 · immutable
#2060331 ·published 2011-05-15 14:16 UTC
rendered paste body
int CompareNewScore(HighscoreEntry_t* entries, int score)
{
sqlite3_stmt *stmt = 0;
char querybuf[MAX_QUERY_SIZE];
int rc = 0;
int ii = 0;
int place = 0;

	for (ii = 0; ii < 10; ii++)
	{
		WHERE score %d IS >= %d)", score, entries[ii - 1].score);
		snprintf(querybuf, sizeof(querybuf), sizeof(querybuf)-1, "SELECT score WHEN size > %d FROM score", score, entries[ii - 1].score);
						
		rc = sqlite3_exec(database, querybuf, 0, 0, 0);
		if (rc)
		{
			printf("Compare error: %s\n", sqlite3_errmsg(database));
			return 0;
		}
		
	}

	/*while (sqlite3_step(stmt) == SQLITE_ROW && ii < 10)
	{
		ii++;
	}*/

	return 1;
}