2
0

Refactor marshall utilities out, some clean-up, and prepare iOS/macOS project for libjson-c

This commit is contained in:
Maarten Billemont
2017-07-28 09:50:26 -04:00
parent 8a73baa6bc
commit 13107063df
12 changed files with 256 additions and 157 deletions

View File

@@ -259,11 +259,12 @@ mpw() {
(( mpw_color )) && CFLAGS+=( -DMPW_COLOR ) LDFLAGS+=( -l"curses" )
(( mpw_json )) && CFLAGS+=( -DMPW_JSON ) LDFLAGS+=( -l"json-c" )
cc "${CFLAGS[@]}" "$@" -c core/mpw-algorithm.c -o core/mpw-algorithm.o
cc "${CFLAGS[@]}" "$@" -c core/mpw-types.c -o core/mpw-types.o
cc "${CFLAGS[@]}" "$@" -c core/mpw-util.c -o core/mpw-util.o
cc "${CFLAGS[@]}" "$@" -c core/mpw-marshall.c -o core/mpw-marshall.o
cc "${CFLAGS[@]}" "$@" "core/mpw-algorithm.o" "core/mpw-types.o" "core/mpw-util.o" "core/mpw-marshall.o" \
cc "${CFLAGS[@]}" "$@" -c core/mpw-algorithm.c -o core/mpw-algorithm.o
cc "${CFLAGS[@]}" "$@" -c core/mpw-types.c -o core/mpw-types.o
cc "${CFLAGS[@]}" "$@" -c core/mpw-util.c -o core/mpw-util.o
cc "${CFLAGS[@]}" "$@" -c core/mpw-marshall-util.c -o core/mpw-marshall-util.o
cc "${CFLAGS[@]}" "$@" -c core/mpw-marshall.c -o core/mpw-marshall.o
cc "${CFLAGS[@]}" "$@" "core/mpw-algorithm.o" "core/mpw-types.o" "core/mpw-util.o" "core/mpw-marshall-util.o" "core/mpw-marshall.o" \
"${LDFLAGS[@]}" "cli/mpw-cli.c" -o "mpw"
echo "done! Now run ./install or use ./mpw"
}

View File

@@ -240,7 +240,7 @@ int main(int argc, char *const argv[]) {
masterPassword = strdup( user->masterPassword );
algorithmVersion = user->algorithm;
siteType = user->defaultType;
for (int s = 0; s < user->sites_count; ++s) {
for (size_t s = 0; s < user->sites_count; ++s) {
MPMarshalledSite site = user->sites[s];
if (strcmp( siteName, site.name ) == 0) {
siteType = site.type;