-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMiniVec.c
More file actions
35 lines (30 loc) · 821 Bytes
/
Copy pathMiniVec.c
File metadata and controls
35 lines (30 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// MiniVec.c
// HeadMaster
//
// Created by Taylor Trimble on 11/11/12.
// Copyright (c) 2013 Tesla Works. MIT license.
//
#include "MiniVec.h"
#include <string.h>
// =============================================================================
// Code
// =============================================================================
void MVSet(char vector[], char vectorCount, char value)
{
memset(vector, value, vectorCount);
}
void MVAdd(char vector[], char vectorCount, char numberToAdd)
{
int index;
for (index = 0; index < vectorCount; ++index) {
vector[index] += numberToAdd;
}
}
void MVRightShift(char vector[], char vectorCount, char bitsToShift)
{
int index;
for (index = 0; index < vectorCount; ++index) {
vector[index] = vector[index] >> bitsToShift;
}
}