sps.c
State moveRow(Table *table, unsigned start, unsigned end) {
    // convert to real addressing
    start--;
    end--;

    unsigned i = start;

    int direction;
    if (i < end)
        direction = 1;
    else
        direction = -1;

    Cell *tmp = table->cells[start];

    while (i != end) {
        table->cells[i] = table->cells[i + direction];
        i += direction;
    }

    table->cells[end] = tmp;
    return SUCCESS;
}
// moves row while shifting the others
moves row while shifting the others
moves row while shifting the others
State moveRow(Table *table, unsigned start, unsigned end) {
    start--;
    end--;
    unsigned i = start;
    int direction;
    if (i < end)
        direction = 1;
    else
        direction = -1;
    Cell *tmp = table->cells[start];
    while (i != end) {
        table->cells[i] = table->cells[i + direction];
        i += direction;
    }
    table->cells[end] = tmp;
    return SUCCESS;
}
State moveRow ( Table * table , unsigned start , unsigned end ) { start -- ; end -- ; unsigned i = start ; int direction ; if ( i < end ) direction = 1 ; else direction = -1 ; Cell * tmp = table -> cells [ start ] ; while ( i != end ) { table -> cells [ i ] = table -> cells [ i + direction ] ; i += direction ; } table -> cells [ end ] = tmp ; return SUCCESS ; }
moves row while shifting the others
moves row while shifting the others
// convert to real addressing