The 1042S covers a variety of forms. United States Income Tax Treaties vary between countries and what is taxable versus what can be removed. There is also taxable income with a foreign tax credit.
Adding the w2 is straightforward. The 1042-S should be added as the type of income it is, but, sometimes other income is the only option. Removing income from the treaty as a negative is correct.
Since you removed all of your w2 and 1042S income that would leave zero taxable. I have never seen w2 wages subtracted before so be sure you are actually entitled to subtract those wages.
Double check the treaty with your country from United States Income Tax Treaties to verify what is taxable and what is not.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"