Skip to content

Commit

Permalink
cleanup some compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Jul 22, 2023
1 parent 7cf6aba commit fea297e
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion codeCore/src/prog8/code/ast/AstPrinter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ fun printAst(root: PtNode, skipLibraries: Boolean, output: (text: String) -> Uni
else
"->"
}
else -> throw InternalCompilerException("unrecognised ast node $node")
}
}

Expand Down
1 change: 0 additions & 1 deletion codeCore/src/prog8/code/target/cx16/CX16Zeropage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class CX16Zeropage(options: CompilationOptions) : Zeropage(options) {
ZeropageType.DONTUSE -> {
free.clear() // don't use zeropage at all
}
else -> throw InternalCompilerException("for this machine target, zero page type 'floatsafe' is not available. ${options.zeropage}")
}

val distinctFree = free.distinct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal class AnyExprAsmGen(
require(expr.left.type in WordDatatypes && expr.right.type in WordDatatypes) {
"both operands must be words"
}
return assignWordBinExpr(expr, assign)
return assignWordBinExpr(expr)
}
DataType.FLOAT -> {
require(expr.left.type==DataType.FLOAT && expr.right.type==DataType.FLOAT) {
Expand All @@ -44,7 +44,7 @@ internal class AnyExprAsmGen(
}
}

private fun assignWordBinExpr(expr: PtBinaryExpression, assign: AsmAssignment): Boolean {
private fun assignWordBinExpr(expr: PtBinaryExpression): Boolean {
when(expr.operator) {
"+" -> {
TODO("word + at ${expr.position}")
Expand Down Expand Up @@ -253,7 +253,6 @@ internal class AnyExprAsmGen(
}
else -> TODO("float expression operator ${expr.operator}")
}
return false
}

private fun setupFloatComparisonFAC1vsVarAY(expr: PtBinaryExpression) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3376,7 +3376,6 @@ internal class AssignmentAsmGen(private val program: PtProgram,
}
}
TargetStorageKind.ARRAY -> assignPrefixedExpressionToArrayElt(makePrefixedExprFromArrayExprAssign("~", assign), scope)
else -> throw AssemblyError("weird target")
}
}
DataType.UWORD -> {
Expand Down Expand Up @@ -3442,7 +3441,6 @@ internal class AssignmentAsmGen(private val program: PtProgram,
}
TargetStorageKind.MEMORY -> throw AssemblyError("memory is ubyte, can't negate that")
TargetStorageKind.ARRAY -> assignPrefixedExpressionToArrayElt(makePrefixedExprFromArrayExprAssign("-", assign), scope)
else -> throw AssemblyError("weird target")
}
}
DataType.WORD -> {
Expand Down Expand Up @@ -3501,7 +3499,6 @@ internal class AssignmentAsmGen(private val program: PtProgram,
}
TargetStorageKind.MEMORY -> throw AssemblyError("memory is ubyte, can't negate that")
TargetStorageKind.ARRAY -> assignPrefixedExpressionToArrayElt(makePrefixedExprFromArrayExprAssign("-", assign), scope)
else -> throw AssemblyError("weird target")
}
}
DataType.FLOAT -> {
Expand Down
1 change: 0 additions & 1 deletion intermediate/src/prog8/intermediate/IRFileWriter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class IRFileWriter(private val irProgram: IRProgram, outfileOverride: Path?) {
is IRInlineAsmChunk -> writeInlineAsm(chunk)
is IRInlineBinaryChunk -> writeInlineBytes(chunk)
is IRCodeChunk -> writeCodeChunk(chunk)
else -> throw InternalCompilerException("invalid chunk")
}
}
xml.writeEndElement()
Expand Down
1 change: 0 additions & 1 deletion intermediate/src/prog8/intermediate/IRProgram.kt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class IRProgram(val name: String,
}
}
is IRInlineBinaryChunk -> { }
else -> throw AssemblyError("invalid chunk")
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions virtualmachine/src/prog8/vm/SysCalls.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package prog8.vm

import prog8.code.core.AssemblyError
import prog8.intermediate.FunctionCallArgs
import prog8.intermediate.IRDataType
import kotlin.math.*
Expand Down Expand Up @@ -484,7 +483,6 @@ object SysCalls {
val result = floor(radians/2.0/PI*256.0)
returnValue(callspec.returns!!, result, vm)
}
else -> throw AssemblyError("missing syscall ${call.name}")
}
}
}
2 changes: 1 addition & 1 deletion virtualmachine/src/prog8/vm/VmProgramLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class VmProgramLoader {

subroutines.forEach {
it.value.chunks.forEach { chunk ->
chunk.instructions.withIndex().forEach { (index, ins) ->
chunk.instructions.withIndex().forEach { (_, ins) ->
if(ins.opcode==Opcode.CALL) {
val fcallspec = ins.fcallArgs!!
val argsWithAddresses = fcallspec.arguments.map { arg ->
Expand Down

0 comments on commit fea297e

Please sign in to comment.