From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 88D392AA6F for ; Tue, 2 Oct 2018 16:51:11 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZDIPWyPzZX5U for ; Tue, 2 Oct 2018 16:51:11 -0400 (EDT) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 2D1BF2A7D9 for ; Tue, 2 Oct 2018 16:51:11 -0400 (EDT) Received: by mail-lj1-f193.google.com with SMTP id 5-v6so3058363lju.6 for ; Tue, 02 Oct 2018 13:51:11 -0700 (PDT) From: AlexeyIvushkin Subject: [tarantool-patches] [PATCH 2/2] sql: remove unused SQLITE_CONSTRAINT_ error codes Date: Tue, 2 Oct 2018 23:50:35 +0300 Message-Id: <160387838b78fe8387a9896f34140a66b887a4f4.1538511704.git.ivushkinalex@gmail.com> In-Reply-To: References: In-Reply-To: References: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Morgan-iv From: Morgan-iv Remove SQLITE_CONSTRAINT_ error codes that only defined, but don't used anywhere. Change its implementation from define macro to enum statement. Part of #3315 --- src/box/sql/main.c | 9 --------- src/box/sql/sqliteInt.h | 13 ++++++------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/box/sql/main.c b/src/box/sql/main.c index 532d324..885cdcc 100644 --- a/src/box/sql/main.c +++ b/src/box/sql/main.c @@ -826,9 +826,6 @@ sqlite3ErrName(int rc) case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break; - case SQLITE_CONSTRAINT_UNIQUE: - zName = "SQLITE_CONSTRAINT_UNIQUE"; - break; case SQLITE_CONSTRAINT_TRIGGER: zName = "SQLITE_CONSTRAINT_TRIGGER"; break; @@ -838,15 +835,9 @@ sqlite3ErrName(int rc) case SQLITE_CONSTRAINT_CHECK: zName = "SQLITE_CONSTRAINT_CHECK"; break; - case SQLITE_CONSTRAINT_PRIMARYKEY: - zName = "SQLITE_CONSTRAINT_PRIMARYKEY"; - break; case SQLITE_CONSTRAINT_NOTNULL: zName = "SQLITE_CONSTRAINT_NOTNULL"; break; - case SQLITE_CONSTRAINT_FUNCTION: - zName = "SQLITE_CONSTRAINT_FUNCTION"; - break; case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break; diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h index 00c0309..5c031e1 100644 --- a/src/box/sql/sqliteInt.h +++ b/src/box/sql/sqliteInt.h @@ -619,13 +619,12 @@ enum sql_ioerr_code { SQLITE_IOERR_GETTEMPPATH = (SQLITE_IOERR | (11<<8)) }; -#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8)) -#define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8)) -#define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8)) -#define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) -#define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) -#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8)) -#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) +enum sql_constrant_code { + SQLITE_CONSTRAINT_CHECK = (SQLITE_CONSTRAINT | (1<<8)), + SQLITE_CONSTRAINT_FOREIGNKEY = (SQLITE_CONSTRAINT | (2<<8)), + SQLITE_CONSTRAINT_NOTNULL = (SQLITE_CONSTRAINT | (3<<8)), + SQLITE_CONSTRAINT_TRIGGER = (SQLITE_CONSTRAINT | (4<<8)) +}; enum sql_type { SQLITE_INTEGER = 1, -- 2.7.4