int32_t for sequence
authorVolker Birk <vb@pep-project.org>
Wed, 18 May 2016 12:21:06 +0200
changeset 652ccc02be8a27d
parent 651 3543ea5e8b02
child 653 a9752fd8d54c
int32_t for sequence
src/pEpEngine.c
src/pEpEngine.h
src/sync_actions.c
sync/gen_actions_skeleton.ysl2
     1.1 --- a/src/pEpEngine.c	Wed May 18 08:46:40 2016 +0200
     1.2 +++ b/src/pEpEngine.c	Wed May 18 12:21:06 2016 +0200
     1.3 @@ -1434,7 +1434,7 @@
     1.4  DYNAMIC_API PEP_STATUS sequence_value(
     1.5          PEP_SESSION session,
     1.6          const char *name,
     1.7 -        int64_t *value
     1.8 +        int32_t *value
     1.9      )
    1.10  {
    1.11      PEP_STATUS status = PEP_STATUS_OK;
    1.12 @@ -1463,7 +1463,7 @@
    1.13          result = sqlite3_step(session->sequence_value2);
    1.14          switch (result) {
    1.15              case SQLITE_ROW: {
    1.16 -                int64_t _value = (int64_t)
    1.17 +                int32_t _value = (int32_t)
    1.18                          sqlite3_column_int64(session->sequence_value2, 0);
    1.19                  *value = _value;
    1.20                  break;
     2.1 --- a/src/pEpEngine.h	Wed May 18 08:46:40 2016 +0200
     2.2 +++ b/src/pEpEngine.h	Wed May 18 12:21:06 2016 +0200
     2.3 @@ -776,7 +776,7 @@
     2.4  DYNAMIC_API PEP_STATUS sequence_value(
     2.5          PEP_SESSION session,
     2.6          const char *name,
     2.7 -        int64_t *value
     2.8 +        int32_t *value
     2.9      );
    2.10  
    2.11  
     3.1 --- a/src/sync_actions.c	Wed May 18 08:46:40 2016 +0200
     3.2 +++ b/src/sync_actions.c	Wed May 18 12:21:06 2016 +0200
     3.3 @@ -31,7 +31,17 @@
     3.4      if (!msg)
     3.5          goto enomem;
     3.6  
     3.7 -    
     3.8 +    int32_t seq;
     3.9 +    status = sequence_value(session, "DeviceGroup", &seq);
    3.10 +    if (status != PEP_STATUS_OK)
    3.11 +        goto error;
    3.12 +
    3.13 +    INTEGER_t *sequence = (INTEGER_t *) calloc(1, sizeof(INTEGER_t));
    3.14 +    assert(sequence);
    3.15 +    if (!sequence)
    3.16 +        goto enomem;
    3.17 +    msg->header.sequence = seq;
    3.18 +
    3.19      return status;
    3.20  
    3.21  enomem:
    3.22 @@ -65,7 +75,17 @@
    3.23      if (!msg)
    3.24          goto enomem;
    3.25  
    3.26 -    
    3.27 +    int32_t seq;
    3.28 +    status = sequence_value(session, "DeviceGroup", &seq);
    3.29 +    if (status != PEP_STATUS_OK)
    3.30 +        goto error;
    3.31 +
    3.32 +    INTEGER_t *sequence = (INTEGER_t *) calloc(1, sizeof(INTEGER_t));
    3.33 +    assert(sequence);
    3.34 +    if (!sequence)
    3.35 +        goto enomem;
    3.36 +    msg->header.sequence = seq;
    3.37 +
    3.38      return status;
    3.39  
    3.40  enomem:
    3.41 @@ -192,7 +212,17 @@
    3.42      if (!msg)
    3.43          goto enomem;
    3.44  
    3.45 -    
    3.46 +    int32_t seq;
    3.47 +    status = sequence_value(session, "DeviceGroup", &seq);
    3.48 +    if (status != PEP_STATUS_OK)
    3.49 +        goto error;
    3.50 +
    3.51 +    INTEGER_t *sequence = (INTEGER_t *) calloc(1, sizeof(INTEGER_t));
    3.52 +    assert(sequence);
    3.53 +    if (!sequence)
    3.54 +        goto enomem;
    3.55 +    msg->header.sequence = seq;
    3.56 +
    3.57      return status;
    3.58  
    3.59  enomem:
     4.1 --- a/sync/gen_actions_skeleton.ysl2	Wed May 18 08:46:40 2016 +0200
     4.2 +++ b/sync/gen_actions_skeleton.ysl2	Wed May 18 12:21:06 2016 +0200
     4.3 @@ -128,7 +128,17 @@
     4.4              if (!msg)
     4.5                  goto enomem;
     4.6  
     4.7 -            
     4.8 +            int32_t seq;
     4.9 +            status = sequence_value(session, "DeviceGroup", &seq);
    4.10 +            if (status != PEP_STATUS_OK)
    4.11 +                goto error;
    4.12 +
    4.13 +            INTEGER_t *sequence = (INTEGER_t *) calloc(1, sizeof(INTEGER_t));
    4.14 +            assert(sequence);
    4.15 +            if (!sequence)
    4.16 +                goto enomem;
    4.17 +            msg->header.sequence = seq;
    4.18 +
    4.19              return status;
    4.20  
    4.21          enomem: